Have example of using Autogeneratecolumns = false in vb.net

Posted by: almahdi on 28 June 2019, 11:09 am EST

    • Post Options:
    • Link

    Posted 28 June 2019, 11:09 am EST

    Hi

    I have select statement with 10 columns and I display 5 columns in C1.Win.C1TrueDBGrid.C1TrueDBGride. I have created the columns, but after running the application, it’s displaying the 10 columns. Can I have an example in vb.net?

    Thanks

  • Posted 1 July 2019, 2:14 am EST

    Hello,

    The property AutogenerateColumns is for FlexGrid control. As TrueDbGrid is specially designed for working in bound mode so the Count property of C1DataColumnCollection Class has getter only because column count is defined by the number of columns in the Datasource.

    If you want to show only limited columns, you can set the visibility of the extra columns to false.

    //This code snippet is to show only 5 columns

     For i As Integer = C1TrueDBGrid1.Columns.Count - 1 To 5 Step -1
      C1TrueDBGrid1.Splits(0).DisplayColumns(i).Visible = False
     Next
    
    

    Please refer to the attached sample for better understanding.

    Thanks and Regards,

    Prabhat Sharma.

    C1TrueDbColsLimitVBDemo.zip

Need extra support?

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

Learn More

Forum Channels