Programmatically sort a trueDbgrid

Posted by: roberto_tomasi on 30 July 2018, 12:10 pm EST

    • Post Options:
    • Link

    Posted 30 July 2018, 12:10 pm EST

    Hi

    there are a way to programmatically sort a trueDbgrid?

    if not is there are a way to know witch column the grid is sorted for?

    Thanks

  • Posted 31 July 2018, 2:54 am EST

    Hi Roberto,

    You can store the value of sorted column inside C1TrueDBGrid1_HeadClick event and then can use it wherever required. Please see the code given below.

    string currSort;

    private void C1TrueDBGrid1_HeadClick(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)

    {

    currSort = "Currently Sorted By: " + c1TrueDBGrid1.Splits[0].DisplayColumns[e.ColIndex].Name;

    }

    Thanks

    +Manindra

  • Posted 31 July 2018, 5:23 am EST

    Hello!

    Thanks, Manindra.

    And Roberto, there is no direct way to sort data in C1TrueDBGrid. I would like to inform you, sorting is performed on underlying data source and not on actual values shown in the grid.

    So, HeadClick event to get sorted column is a simpler option to be used in this situation.

    http://help.grapecity.com/componentone/NetHelp/c1truedbgrid/webframe.html#C1.Win.C1TrueDBGrid.4~C1.Win.C1TrueDBGrid.C1TrueDBGrid~HeadClick_EV.html

    Regards,

    Meenakshi

  • Posted 2 August 2018, 10:53 am EST

    Thanks, Manindra. its fine

Need extra support?

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

Learn More

Forum Channels