473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Grid SortCommand one more time

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.DataGridSortCommandEvent Handler(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


Nov 18 '05 #1
1 1314
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 )

"gerry" <ge**@hotmail.com> wrote in message
news:ei**************@TK2MSFTNGP11.phx.gbl...
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.DataGridSortCommandEvent Handler(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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
0
by: Matthew Louden | last post by:
I am trying to implement the sort event in data grid. I set the data grid's AllowSorting property = True. I implement the following code that should be the event will fire when the user click any...
0
by: Daniel Bass | last post by:
I've got a data grid, with paging, and sorting allowed. I can find loads of examples, and have previous done this, when generating all the data from my database at run time, progmatically. Now...
1
by: Nikhil Patel | last post by:
Hi all, I have written an ASP.Net form that displays a sortable grid. I works fine in Internet Explorer. But it gives me an error when I try to display it in 3rd party application. The error says...
3
by: IGotYourDotNet | last post by:
I need to make my grids sortable when the user clicks a header (I know how to do use using SQL) but how make the grids columns sorttable when the grids are populated via a Oracle Stored Procedure?...
1
by: Linda | last post by:
Hi, I'm new to asp.net and tryign to learn how to work with data grids. I'm retrieving data from a stored procedure and putting it in a data grid. I then want to be able to sort the data when...
0
by: lien | last post by:
In march 23, 04. Steven Cheng showed us how to do sortcommand for datagrid created at run time (thank you) . What if I have mixed static and dynamic columns? that is colunms added into static...
0
by: Daniel Bass | last post by:
I've already posted this in the asp forum, and other asp.net forums on the net with no luck... I've got a data grid, with paging, and sorting allowed. I can find loads of examples, and have...
1
by: Alex Maghen | last post by:
I have a DataGrid on my ASPX and I'm confused about the interaction with the page based on whether the page is just loading or is being reloaded with a call to the SortCommand of the DataGrid: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.