Sort Silverlight C1Datagrid Column

Posted by: d.krishnap on 12 December 2017, 9:18 pm EST

    • Post Options:
    • Link

    Posted 12 December 2017, 9:18 pm EST

    Hi,

    I have AGE column showing converted Datetime field value to string from query showing in format like Days:1 h:1 m:58 But when i click on sort i doesnt sort as per AGE value due to string . Can you please how to achieve this sort column from code behind or any other way ?

    I was trying by taking another hidden column CREATEDCOLUMN and sorting this column when AGE column is sorted but it doest shows sorted symbol in AGE column and when we try again it sorts ASC order instead of Desc order. Can you please show solution for this or with any sample if you have .

    Thanks

    Krishna

  • Posted 13 December 2017, 4:42 pm EST

    Hi,

    You can achieve the same using SortMemberPath property of DataGridColumn as:

    this.dataGrid.Columns["Age"].SortMemberPath = "Dob";  // property name on which you want to actual sort
    

    For more info: http://help.grapecity.com/componentone/NetHelp/c1datagridwpf/webframe.html#C1.Silverlight.DataGrid.5~C1.Silverlight.DataGrid.DataGridColumn~SortMemberPath.html

    Thanks,

    Singh

  • Posted 13 December 2017, 8:51 pm EST

    Thanks Singh its works .

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels