How to reorder table columns in a C1TrueDBGrid

Posted by: Victor.m.charles.civ on 29 January 2020, 1:42 pm EST

    • Post Options:
    • Link

    Posted 29 January 2020, 1:42 pm EST

    Hi,

    How do I position the columns in my Grid? Unfortunately the columns in the table that I’m using to load is not in the proper order. For example I want to display columns.

    Name address, zip, location, occupation

    but the table does not have the columns in the same order.

    Thanks,

    Victor

  • Posted 30 January 2020, 1:06 am EST

    Hi Victor,

    You can use the code snippet given below to show your columns in different order as compare to the DataSource.

    Dim col = C1TrueDBGrid1.Splits(0).DisplayColumns("ColumnName")        C1TrueDBGrid1.Splits(0).DisplayColumns.RemoveAt(C1TrueDBGrid1.Splits(0).DisplayColumns.IndexOf(col))
    C1TrueDBGrid1.Splits(0).DisplayColumns.Insert(position, col)
    

    Please go through the attached sample demonstrating the same.

    Regards,

    Prabhat Sharma.

    TDBReorderingDemo.zip

  • Posted 30 January 2020, 9:57 am EST

    Thank You.

Need extra support?

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

Learn More

Forum Channels