Grid SortCommand one more time

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
 
G

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 )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top