Grid SortCommand one more time

  • Thread starter Thread starter gerry
  • Start date Start date
G

gerry

I have seen many posts regarding a the grid SortCommand even not firing but
haven't been able to determine what the problem is.

The grid is contained in a UserControl which is added to the page at runtime
The Control's InitializeComponent method contains : this.DGrid.SortCommand
+=new
System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.DGRid_SortCom
mand);

Everything was working fine and the SortCommand event was firing but
somewhere along the line it has stopped.

In the Page_Init & Page_Load methods of the UserControl
Request["__EVENTTARGET"] has the value
SectionCtl:SectionCtl:DGrid:_ctl1:_ctlN , this does not look right to me, I
was expecting to see a value of SectionCtl:SectionCtl:DGrid:_ctlN I don't
know what the initial _ctl1 is referring to.
Is there anyway to determine what the proper target id should be ?
Is there a way to trace through the event processing logic to determine why
the event handler is not being invoked ?

EnableViewState & AutoGenerateColumns values are having no effect.

any insight here would be greatly appreciated

gerry
 
figured it out , grid binding was removed from Page_Load and moved to
Page_PreRender to cut down on processing.
binding has now been moved into seperate method which is called from both
Load & PreRender but only does anything in PreRender if it is required due
to control state changes ( sorting etc )
 
Back
Top