C1TrueDbGrid: Selecting all rows programmatically

Posted by: mchen on 3 May 2018, 1:52 pm EST

    • Post Options:
    • Link

    Posted 3 May 2018, 1:52 pm EST

    I know this is possible by looping through the rows and adding each one to the selected rows collection. However, this is really slow for grids with many rows.

    You can select all rows using the UI very quickly by selecting the first row using the record selector, scrolling to the last row, holding down the shift key and then selecting the last row.

    Is there a way to replicate this programmatically or another way that performs much better?

  • Posted 4 May 2018, 1:18 am EST

    Hi Madeline!

    Can you please try Add(Int32) overload (http://help.grapecity.com/componentone/NetHelp/c1truedbgrid/webframe.html#C1.Win.C1TrueDBGrid.4~C1.Win.C1TrueDBGrid.SelectedRowCollection~Add(Int32[]).html), that accepts range of rows’ numbers to add in selected rows collection?

    While using this, you need to create an integer array containing values from first row index to the last row index. Next, you can simply pass this as parameter to the Add method. This lets you make only a single call to the method in your code.

    I hope this should help you.

    Best regards,

    Meenakshi

  • Posted 4 May 2018, 2:21 pm EST

    Thank you, I’m guessing that overload must have been a recent addition, I don’t see it in 4.0.20161.139.

  • Posted 7 May 2018, 12:37 am EST

    Oh! Actually, this overload was introduced in 2016-V2 build. So, if your license is valid for this version then I suggest you to upgrade through C1Live utility.

    Please note, any license key subscription is valid for four trimesters only. Suppose you have license key of 2016-V1, you can use this serial key for controls of version 2016-V1, 2016-V2, 2016-V3, and 2017-V1.

    Let me know if you need any further help on this.

    • Meenakshi
Need extra support?

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

Learn More

Forum Channels