I have a DataGrid which I am adding to the page dynamically at the Init stage
of the page load. The DataGrid has AutoGenerateColumns turned off, has
BoundColumns and is bound to a DataView for its’ data source. I have also
added a TemplateColumn which is defined in a derived class and contains an
ImageButton. The derived TemplateColumn class contains an event handler for
DataBinding and in this handler I assign the ImageButton ID. The page that
contains my DataGrid contains two event handlers ItemCommand and SortCommand.
I have recently posted regarding a toggled sorting, which I have implemented
successfully. Although, since implementing the sorting I now have a very
strange behaviour occurring. When testing the toggled sorting I noticed that
the ItemCommand and SortCommand events stop firing if the columns are sorted
more than once, i.e. If you click the ImageButton (TemplateColumn) after
clicking the column headers more than once the page refreshes but neither the
ItemCommand or the SortCommand event fires. This is almost as if the event
delegate is lost for the TemplateColumn on the second round trip. Anyone
ideas would be gratefully received!
--
MG