Programmatically created Radgrid..... sorting issues

6 posts, 0 answers
  1. Anita
    Anita avatar
    13 posts
    Member since:
    Jan 2010

    Posted 13 Mar 2010 Link to this post

    Hi all,

    I am new to telerik controls.... I have a radgrid in my application where the columns are generated at runtime based on user selection (user selects the display columns from a checkbox list, and also the number of columns are not fixed). I loop through the collection, and add the colums to the grid in code-behind.  I use the need_DataSource event to bind the grid. The grid displays the data columns correctly based on what the user has clicked. When I click on the column header to sort, the header text disappears, and the column data remain unaltered.
     
    I guess I am calling the function which adds columns to the grid in the wrong place. Please any help regarding this would be appreciated. 

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 15 Mar 2010 Link to this post

    Hi Anita,

    Please verify that you follow strictly the conventions for dynamic grid structure creation explained here and the problem should be eliminated.

    Regards,
    Pavlina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anita
    Anita avatar
    13 posts
    Member since:
    Jan 2010

    Posted 22 Mar 2010 Link to this post

    Thanks.
    The issue was about adding columns to the collection first, and then set properties.
    I was doing the otherway around.
  5. Jeremy
    Jeremy avatar
    96 posts
    Member since:
    Mar 2010

    Posted 16 May 2010 Link to this post

    Awesome! Had exactly the same problem. :)

    PS link above is slightly broken
  6. Mike
    Mike avatar
    20 posts
    Member since:
    Jan 2011

    Posted 10 Feb 2011 Link to this post

    I'm having this same problem but have not been able to resolve it.

    I am creating the grid in the Page_Init and am creating the columns and their attributes *before* adding them to the column collection (per the help article).

    Filtering seems to be working fine but the sorting just doesn't seem to be doing anything other than reloading the grid with the data scrambled rather than sorted. 

    I am binding to a declared object data source and have set sort expressions for each column.

    Any ideas?

    Mike
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 16 Feb 2011 Link to this post

    Hello Mike,

    Try setting the OverrideDataSourceControlSorting property of the grid to true and let me know if this helps.
    OverrideDataSourceControlSorting Property

    Greetings,
    Pavlina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017