Sorting a C1TrueDBGrid

Posted by: beheerder on 9 August 2018, 8:43 am EST

    • Post Options:
    • Link

    Posted 9 August 2018, 8:43 am EST

    Hi,

    If have a C1TrueDBGrid bound to a datasource (typed datatable), which contains a SortOrder column. This way, the user can change the order of the rows.

    When the user moves a row up or down, i just change the number in the datatable SortOrder column programmatically.

    This works ok, but now i have to reorder the data without re-filling the datasource.

    In a C1Flexgrid i just call the .Sort Method to re-order on a specific column.

    How can i do this in a C1TrueDBGrid?

  • Posted 9 August 2018, 8:46 am EST

    By the way, i am using VB.NET

  • Posted 10 August 2018, 6:48 am EST

    Hi,

    TrueDBGrid does not have programmatic sorting like FlexGrid. You would need to modify the DataSource for applying a sort order.

    However, if you only need simple sort then you can take the DataTable’s DataView and set an appropriate Sort property to apply sorting on a column.

    You can refer to the attached sample to see an example.

    Thanks.

    SortTrueDBGridVB.zip

  • Posted 10 August 2018, 8:54 am EST

    Hi,

    Thanks for the quick response. I will give it a try.

    Kind regards,

    Willy

Need extra support?

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

Learn More

Forum Channels