|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieve GridView column header text on sortHow do I programmatically retrieve GridView column header text on a
BoundField when the user click on the header sort button? I know about the GridView columns collection, but how do I get the column id that corresponds with the sort button that the user clicked on? Thanks in advance, Necqui Hi Necqui,
Welcome to ASPNET newsgroup. As for the retrieving and setting a certain BoundField's Header text in GridView, based on my research, since the GridView's Columns collection only support index accessor, I'm afraid currently we have to loop through the Columns collection and compare each Field's SortExpression with the current sorting column and get the correct sorting column we want. and the GridView's sorting event is the proper place to put the code. Also, if it is possible that we hard code a function which help mapping sortexpression string to an int index, that'll be much better for performance consideration. (But for dynamically peform such task, we have to loop the columns collection). Thanks, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) -------------------- | From: "Necqui Teja" <NecquiT@nospam.nospam> microsoft.public.dotnet.framework.aspnet.webcontrols:31064| Subject: Retrieve GridView column header text on sort | Date: Thu, 10 Nov 2005 11:51:30 -0800 | Lines: 11 | X-Priority: 3 | X-MSMail-Priority: Normal | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830 | X-RFC2646: Format=Flowed; Original | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 | Message-ID: <#B9WmAj5FHA.2***@TK2MSFTNGP09.phx.gbl> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols | NNTP-Posting-Host: 216.57.203.121 | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl | Xref: TK2MSFTNGXA02.phx.gbl Show quoteHide quote | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols | | How do I programmatically retrieve GridView column header text on a | BoundField when the user click on the header sort button? | | I know about the GridView columns collection, but how do I get the column id | that corresponds with the sort button that the user clicked on? | | Thanks in advance, | | Necqui | | | Hi Necqui,
Any further progress on this issue? Just post to see whether there're anything else we can help. Thanks, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) -------------------- Show quoteHide quote | X-Tomcat-ID: 78665377 microsoft.public.dotnet.framework.aspnet.webcontrols:31077| References: <#B9WmAj5FHA.2***@TK2MSFTNGP09.phx.gbl> | MIME-Version: 1.0 | Content-Type: text/plain | Content-Transfer-Encoding: 7bit | From: stch***@online.microsoft.com (Steven Cheng[MSFT]) | Organization: Microsoft | Date: Fri, 11 Nov 2005 04:18:53 GMT | Subject: RE: Retrieve GridView column header text on sort | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols | Message-ID: <P2ofQcn5FHA.***@TK2MSFTNGXA02.phx.gbl> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols | Lines: 52 | Path: TK2MSFTNGXA02.phx.gbl | Xref: TK2MSFTNGXA02.phx.gbl Show quoteHide quote | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122 | | Hi Necqui, | | Welcome to ASPNET newsgroup. | As for the retrieving and setting a certain BoundField's Header text in | GridView, based on my research, since the GridView's Columns collection | only support index accessor, I'm afraid currently we have to loop through | the Columns collection and compare each Field's SortExpression with the | current sorting column and get the correct sorting column we want. and the | GridView's sorting event is the proper place to put the code. Also, if it | is possible that we hard code a function which help mapping sortexpression | string to an int index, that'll be much better for performance | consideration. (But for dynamically peform such task, we have to loop the | columns collection). | | Thanks, | | Steven Cheng | Microsoft Online Support | | Get Secure! www.microsoft.com/security | (This posting is provided "AS IS", with no warranties, and confers no | rights.) | | | | | | | -------------------- | | From: "Necqui Teja" <NecquiT@nospam.nospam> | | Subject: Retrieve GridView column header text on sort | | Date: Thu, 10 Nov 2005 11:51:30 -0800 | | Lines: 11 | | X-Priority: 3 | | X-MSMail-Priority: Normal | | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830 | | X-RFC2646: Format=Flowed; Original | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 | | Message-ID: <#B9WmAj5FHA.2***@TK2MSFTNGP09.phx.gbl> | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols | | NNTP-Posting-Host: 216.57.203.121 | | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl | | Xref: TK2MSFTNGXA02.phx.gbl | microsoft.public.dotnet.framework.aspnet.webcontrols:31064 | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols | | | | How do I programmatically retrieve GridView column header text on a | | BoundField when the user click on the header sort button? | | | | I know about the GridView columns collection, but how do I get the column | id | | that corresponds with the sort button that the user clicked on? | | | | Thanks in advance, | | | | Necqui | | | | | | | |
Finding a way to bind ASP.NET controls(two way) to a typed-dataset
Datagrid paging I lose my sort Postback in Web Controls client-side .NET control how to override DropDownList.SelectedValue property Coloring Calendar !!! Status text Combining 2 Fields Using ListBox.DataTextField DropDownList LoadControl and Multiple IDs in UserControls Error |
|||||||||||||||||||||||