Some help with this would be appreciated.
I am programmatically adding a LinkButton to my DataGrid at run time (in the datagrid.ItemDataBound event).
All works well and is displayed as expected until I click the LinkButton - the datagrid.ItemCommand is not firing.
As a temporray hack, if I reload the data on postback into the dataset and re-bind to the DataGrid - it then works fine.
As the query is potentially big I would rather not have to issue the query again.
I have EnableViewState turned on so data is retained - but it seems the events are losing their pointers, and it seems the only way to re-link them is to re-bind each time.
Is there any way I can avoid having to re-bind on each postback?
Any help greatly appreciated. Thanks.
I am programmatically adding a LinkButton to my DataGrid at run time (in the datagrid.ItemDataBound event).
All works well and is displayed as expected until I click the LinkButton - the datagrid.ItemCommand is not firing.
As a temporray hack, if I reload the data on postback into the dataset and re-bind to the DataGrid - it then works fine.
As the query is potentially big I would rather not have to issue the query again.
I have EnableViewState turned on so data is retained - but it seems the events are losing their pointers, and it seems the only way to re-link them is to re-bind each time.
Is there any way I can avoid having to re-bind on each postback?
Any help greatly appreciated. Thanks.