Eliyahu:
No, the data grid is not created at runtime. I have it on the form. I
create the columns and I fill them in a for loop. I dynamically create
the columns for the datagrid and add them to it. I then create a
datatable, add the columns to the datatable. I then create rows and
populate the columns of the rows and add them to the datatable. Then I
create a data using the datatable, for the datagrid. I call the
procedures, to create and fill the columns\rows, when the page is
loaded, inside if (!IsPostBack). I tried to save the
datagrid.datasource to a session var, then reassign it to the datagrid,
but there are no rows in it. I am not sure what event to put this in,
in order save it before the postback. What else could I be missing?
Thanks
Eliyahu Goldin wrote:
Do you create the datagrid itself in runtime too? If you do, you have to
re-create it on every postback.
Eliyahu
"gh" <gh@attt.net> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
I create the columns for the asp.net datagrid at runtime and populates
them. I have a template column for checkboxs I created at runtime as well.
The user selects the product they want by checking the checkbox, next to
it. In the submit button I loop through the datagrids items and if checked
I will save the product to the cart. The problem is the grid has no item
count when I try to loop through it.
I loop through the rows of the grid right after I populate and add the
rows, in code, to make the checkboxs visible for certain rows and it works
great. Does it have something to do with the postback after clicking the
submit button?
Thanks