D
Del
I'm creating a dynamic datagrid using Dim objbc As New BoundColumn, etc. The
datagrid is populating correctly. I am also using first column of grid as
'edit', on clicking this the update link is displayed and textboxes are
returned. All good so far.
When I change the values in the text box and click update, I keep getting:
Specified argument was out of the range of valid values. Parameter name: index
for this line
tb = CType(e.Item.Cells(1).Controls(0), TextBox)
I've checked the content of e.item.cells and it is empty, why????
If I create the datagrid and bind it directly to a dataset then everything
works, however I want to create the dataset, etc. completely dynamically.
What am I missing? I've seen much correspondence of others getting the same
issue, but there are no answers. After much searching I did find a post
suggesting that the issue is due to viewstate, and that the binding of the
columns should be done on Page_Init and not Page_Load. Is this the solution
I'm looking for?
datagrid is populating correctly. I am also using first column of grid as
'edit', on clicking this the update link is displayed and textboxes are
returned. All good so far.
When I change the values in the text box and click update, I keep getting:
Specified argument was out of the range of valid values. Parameter name: index
for this line
tb = CType(e.Item.Cells(1).Controls(0), TextBox)
I've checked the content of e.item.cells and it is empty, why????
If I create the datagrid and bind it directly to a dataset then everything
works, however I want to create the dataset, etc. completely dynamically.
What am I missing? I've seen much correspondence of others getting the same
issue, but there are no answers. After much searching I did find a post
suggesting that the issue is due to viewstate, and that the binding of the
columns should be done on Page_Init and not Page_Load. Is this the solution
I'm looking for?