|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sorting only certain columns in datagridHi
I'm binding a dataset to my datagrid at runtime, and I want to allow sorting only on certain columns. How do I do this? If I set AllowSorting to true, all the column headers are underlined and sortable; if I set it to false, none of them are, even if I set the SortExpression property for the columns that I want to be sortable. I'm sure it can be done, and it's probably easier to do it at design time, but as I say I'm only binding the grid to the datasource at runtime. you won't be able to remove the links ahead of time without a lot of
difficulties, but one good workaround is simply to cancel the sort event if it isn't allowed, with probably an appropriate user message. -- Show quoteHide quoteRegards, Alvin Bruney [MVP ASP.NET] [Shameless Author plug] The Microsoft Office Web Components Black Book with .NET Now Available @ www.lulu.com/owc Forth-coming VSTO.NET - Wrox/Wiley 2006 ------------------------------------------------------- "Cathryn Johns" <cjo***@gmail.com> wrote in message news:1131359215.019988.253970@z14g2000cwz.googlegroups.com... > Hi > > I'm binding a dataset to my datagrid at runtime, and I want to allow > sorting only on certain columns. How do I do this? If I set > AllowSorting to true, all the column headers are underlined and > sortable; if I set it to false, none of them are, even if I set the > SortExpression property for the columns that I want to be sortable. > > I'm sure it can be done, and it's probably easier to do it at design > time, but as I say I'm only binding the grid to the datasource at > runtime. > Cathryn Johns wrote:
> *Hi I am also facing the same prob. if u find out the solution please let
me know.> > I'm binding a dataset to my datagrid at runtime, and I want to allow > sorting only on certain columns. How do I do this? If I set > AllowSorting to true, all the column headers are underlined and > sortable; if I set it to false, none of them are, even if I set the > SortExpression property for the columns that I want to be sortable. > > I'm sure it can be done, and it's probably easier to do it at design > time, but as I say I'm only binding the grid to the datasource at > runtime. * Harry -- hkghawania ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------
Error in DataList test query - aspnet 2.0
getting Membership userid to use and store in a custom database Gridview Updates not writing to database after clicking update General Event Handler For Runtime Buttons Dynamically Adding DataLists Custom DropDownList Control and ListItem GridView DataFormatString not formatting how to handle multiple events from a control collection? How can I let the user resize the Multipage or PageView? Improving the benefit out of the Web-based newsreader |
|||||||||||||||||||||||