sort a column via HeaderContextMenu

7 posts, 0 answers
  1. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 15 Oct 2013 Link to this post

    Hi,

    I have a RadGrid implemented where I use a column in the dataset that is not shown to sort a column (Quality_Sort) that is shown in the RadGrid.
    I do this by assigning the 'sort'-column to the sortexpression of the boundcolumn.
    boundColumn.SortExpression = "Quality_Sort";

    The GridBoundColumn can have value 'Low', 'Medium' and 'High'.
    In the column 'Quality_Sort' these values are represented as 1, 2 and 3.

    When I click on the header of the column the sorting works as expected ('Low' > 'Medium' > 'High'). When I select the option 'Sort Ascending' from the headercontextmenu the sorting will result in an alphabetical sorting ('High' > 'Low' > 'Medium').

    Is this a bug?

    Paul
  2. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 18 Oct 2013 Link to this post

    Hello,

     You can handle the ItemCommand of the grid check the what sort expression is assigned in each case. If necessary you can modify the sort expression and rebind the control to achieve the desired sorting.
    Generally sorting from the header context menu should result in the same sort expression assinged to the grid.

    Regards,
    Marin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 18 Oct 2013 Link to this post

    As the sorting from the header context menu does NOT result in the same sort expression assigned I conclude this is a bug.

    When will this be solved?

    Paul
  5. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 18 Oct 2013 Link to this post

    Hello,

     Are both types of sorting (header and header context menu) targeted towards the same field in the datasource?
    It will be helpful if you can send us a sample runnable project so we can check it on our side and let you know if this is an issue with the control or problem with the setup.

    Regards,
    Marin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 18 Oct 2013 Link to this post

    I cannot upload upload a zip-file.
    (Reply to thread cannot be created because:
    • Please upload valid files: .gif,.jpg,.jpeg,.png smaller than 2MB.)


    Paul
  7. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 18 Oct 2013 Link to this post

    Hello,

     If the file is larger than 2 MB you can open a support ticket and attach it there or if you prefer you can upload it to a file sharing web site and provide the link to download it from there.

    Regards,
    Marin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  8. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 18 Oct 2013 Link to this post

    I have added the test application to the ticked 748535.

    (zip files are not allowed here, even when the size is 23kB).

    Paul
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017