Location and Width of a split in a C1TrueDBGrid

Posted by: kmeads on 2 April 2021, 3:46 am EST

  • Posted 2 April 2021, 3:46 am EST

    I am trying to get the width and location, in pixels, of a split in a C1TrueDBGrid. I cannot seem to find it! While debugging, I can inspect the Split and I do see ClientRect which has all of the information that I need, but as it turns out, that is a protected member for some reason so I cannot access it. I've been through the documentation for the control but I cannot find anything that directly provides that information. Am I missing something?
  • Replied 4 April 2021, 6:10 pm EST

    Hi,

    The actual size of the split at run-time depends on its SplitSize and SplitSizeMode properties. The SplitSizeMode property specifies the unit of measurement; the SplitSize property specifies the number of units. You can use these properties of the splits to calculate the width of a split accordingly. Since ClientRect has all information that you need and you only need to get the width and location, you can use reflection to get the value of the ClientRect property of the Split. Please refer to the sample attached.

    Regards.
    Avnish
    TDBSplitLocaion.zip
Need extra support?

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

Learn More

Forum Channels