G
Good Enchiladas
I have a class inheriting from CollectionBase that is displayed in a
datagrid. When the user clicks on a button, the current record in the data
grid is deleted.
Unfortunately, I have to populate my CollectionBase class first in the
Page_Load event then databind it to the datagrid. Then the button click
event uses the populated datagrid to determine the currently selected row
and then performs the delete. Then in the Page_PreRender event I have to
again populate my CollectionBase class and databind it a second time to the
datagrid in order to get the deleted record to disappear.
If I don't load the grid in Page_Load, the button click doesn't fire. If I
don't load in Page_PreRender (or some event after the button click event)
then the record won't disappear from the datagrid.
This seems really wasteful. I have to be doing something wrong. Can someone
tell me a better way to get this working?
datagrid. When the user clicks on a button, the current record in the data
grid is deleted.
Unfortunately, I have to populate my CollectionBase class first in the
Page_Load event then databind it to the datagrid. Then the button click
event uses the populated datagrid to determine the currently selected row
and then performs the delete. Then in the Page_PreRender event I have to
again populate my CollectionBase class and databind it a second time to the
datagrid in order to get the deleted record to disappear.
If I don't load the grid in Page_Load, the button click doesn't fire. If I
don't load in Page_PreRender (or some event after the button click event)
then the record won't disappear from the datagrid.
This seems really wasteful. I have to be doing something wrong. Can someone
tell me a better way to get this working?