cancel
Showing results for 
Search instead for 
Did you mean: 

WebForm Datagrid binding

Former Member
0 Kudos

Hi Reiner,

As discussed in the last post, i managed to pass over tables from one page to another, however i am unable to code my application properly.

This is because of the object which i am passing to the second page, it has a routine in the first page in Page_Load which retrieves the session state from the 2nd page on the updated table. The problem is that if page loads up after SAPLogin.aspx and after exiting from the first page into the next, if i send out an the table in my button event handler, it will send as Nothing. I am trying to trap the Page_Load section with some kind of code that does not do a <b>Proxy.tblItems = CType(Session.Item("MYTABLE"), BAPIXXXTable)</b> on Page_Load until after the new item in the 2nd page has been added. i tried to read the properties of the table Proxy.tblitems, however it gives me an error, as usual no object instance ... blah blah blah

Accepted Solutions (1)

Accepted Solutions (1)

reiner_hille-doering
Active Contributor
0 Kudos

Please note in your designer that the Session state is a global bag for everything in your app. You wouldn't store there something for a special page, but just globally.

A good practice that all participating pages have a member variable of the common tables (e.g. order items), e.g. it#s called tblItems. An participating pages have common block like this in there Page_Load

tblItems = CType(Session.Item("MYTABLE"), BAPIXXXTable)

if tblItems = Nothing

tblItems = New BAPIXXXTable()

This ensures that all pages see the same table instance, but it's never uninitialized.

Former Member
0 Kudos

Thanks...its been helpful and stars have been rewarded

One more thing..how do i manage datagrids in ASP.net web app if i want to have checkboxes at the side to select items...like those email applications? cheers

reiner_hille-doering
Active Contributor
0 Kudos

DataGrid can have so-called "template columns", where you can put in any ASPX, control, including checkboxes.

BTW: You could also use PDK .NET which comes with nice controls that have nice customizable branding and a lot of feature. E.g. the SAP Table control has rich set to control selection.

Former Member
0 Kudos

yea i was wondering is it the PDK.Net available in Sap Service?

Former Member
0 Kudos

ok, i've downloaded it, apparently it is for me to build iviews for EP...enclosed with the runtime server, which is a generic RFC server app, and stuff inside VS.

Question #1: If I have NCo 2.0 installed already, do i need to remove it completely before installing the PDK?

Question #2: Documentation i read says that I can hot delpoy into EP. However if I want to build my ASP.Net WebForm, running on IIS, is this possible? Or do i have to do it normally?

Question #3: I tried to insert a template column in my datagrid, somehow i can't put a checkbox there via designer mode. Must I do it programatically?

Thanks in advance

Former Member
0 Kudos

1. no

2. PDK is not meant to be used to run iViews on IIS. see overview https://media.sdn.sap.com/html/submitted_docs/PDK_for_dotNET_10/Getting%20Started/Overview.htm).

3. If you are talking about the SAP table control, at the moment you can't put a check box in the table in design time, only programmatically. (best use the itemCreated even). Only "read only" controls can be put there.

Regards,

Ofer

reiner_hille-doering
Active Contributor
0 Kudos

3. Setting SelectionMode to SINGLE might be exactly what you want.

Former Member
0 Kudos

Hi guys

my replies:

2. As i suspected

3. Don't get you I am building on IIS using ASP.Net and conector 2.0 to 4.6 system. using RFC from ASP.Net application and binding my table to a datagrid...Reiner said that i can use a template column to simulate a checkbox but i can't seem to find it. also SelectionMode is not found in the toolbox. what can i do?

reiner_hille-doering
Active Contributor
0 Kudos

3. My answer about SelectionMode is about the SAP.Web.UI.Controls.Table control that comes with the PDK. If you - for any reason - don't want to use the PDK, you have to use Microsoft's DataGrid.

Former Member
0 Kudos

3. If you have a question about the Microsofts DataGrid... you might want to go to <b>M</b>SDN

Answers (0)