Hi,
I'm using a DataGrid with ViewState disabled, so I rebind data after each
postback from the page's Sub OnLoad.
Inside one of the DataGrid column, there is a custom LinkButton to trigger a
Click event.
When this button is clicked, it displays a form (outside the datagrid) so
that the row can be edited.
The code is:
Sub row_Edit(sender As Object, e As EventArgs)
Dim link As LinkButton = CType(sender, LinkButton)
Dim row As DataGridItem = CType(link.NamingContainer, DataGridItem)
Dim view As DataRowView = CType(row.DataItem, DataRowView)
.....
End Sub
The problem is that row.DataItem is Nothing...
Why ?
As data is rebinded inside the page's OnLoad, and the linkbutton event is
triggered after, DataItem should be set...
Thanks for your help