RadGrid column sorting from a bound List

7 posts, 0 answers
  1. Eli
    Eli avatar
    10 posts
    Member since:
    Feb 2019

    Posted 22 Apr 2019 Link to this post

    Hopefully someone can point me in the right direction.

     

    I have a Grid that i populate from a list that i get from my backend. it works great like this. i do have paging that works, but sorting is one i am having trouble with.

     

    I set the allowsort property to true, but the columns do not allow me to click on them to sort.

     

    Any Suggestions?

  2. Eyup
    Admin
    Eyup avatar
    3892 posts

    Posted 25 Apr 2019 Link to this post

    Hi Elisha,

    Ensure that you are binding the grid via the NeedDataSource event:
    https://www.telerik.com/support/kb/aspnet-ajax/grid/details/how-to-bind-radgrid-properly-on-server-side

    And if you are using template columns, make sure that have their DataField and SortExpression properties set:
    <telerik:GridBoundColumn DataField="ShipName"
        FilterControlAltText="Filter ShipName column" HeaderText="ShipName"
        SortExpression="ShipName" UniqueName="ShipName">

    I hope this will prove helpful.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Eli
    Eli avatar
    10 posts
    Member since:
    Feb 2019

    Posted 03 May 2019 in reply to Eyup Link to this post

    Thank you for your Help, However i am still unable to get sorting working.

    At least now the grid does not disappear completely when i try to click on the sort option.

    i did add a OnNeedDataSource="grdPNGrid_NeedDataSource" to my page and

    to my code i added

    protected void grdPNGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
            {
                if (!e.IsFromDetailTable)
                {
                    grdPartyName.DataSource = lstSearchResults;
                }
            }

    Still i cannot seem to get sorting to work at all. the columns highlight as i would apply sorting, i even get the little arrow to signify ascending and descending sort but it simply will not.

    I did have the grid inside of an updatepanel, i tried removing it, but it still does not sort. i also tried adding the radajaxmanager in a way that work, but even with it and the grid outside of the updatepanel, it did not load at all. so once i removed the updatepanel completely and kept the ajaxmanager, it still did not sort. i ususlly have to keep the radajaxmanager out as it causes problems with using the updatepanel.

     

    I am totally confused at this point.

  4. Eyup
    Admin
    Eyup avatar
    3892 posts

    Posted 08 May 2019 Link to this post

    Hi Elisha,

    I am sending a sample RadGrid web site with working sorting functionality. You can use it as a base reference and built your configuration on top of it step by step.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Eli
    Eli avatar
    10 posts
    Member since:
    Feb 2019

    Posted 16 May 2019 in reply to Eyup Link to this post

    Awesome, Thank you

    . but i do not see what you have sent. i do not have anything in my email or here.

  6. Eyup
    Admin
    Eyup avatar
    3892 posts

    Posted 17 May 2019 Link to this post

    Hello Eli,

    Yes, you need to have RadGridSortBasicSample.zip sample attached to the previous post. I am also attaching it to this reply.

    If you don't see the sample once again, you can check for spam filter of your company.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  7. Eli
    Eli avatar
    10 posts
    Member since:
    Feb 2019

    Posted 17 May 2019 in reply to Eyup Link to this post

    Awesome, again Thank You.

    for me the previous post did not have the file attached but this one did.

    i will see what i can do with it.

Back to Top