C1TrueDBGrid not trimming/clipping properly

Posted by: abraham on 1 May 2025, 8:27 pm EST

  • Posted 1 May 2025, 8:27 pm EST

    Using a C1TrueDBGrid (latest version 8.x) in .NET 9 the following bugs pop up:

    • when the Grid / Split / DisplayColumn Trimming property is set to ‘Character’ and the Wrap property to ‘NoWrap’; the column contents are NOT clipped properly when the VerticalAlignment property is set top ‘Center’ (it then uses word-level trimming).
    • also in this situation the column does use wrapping although it has been set not to.
    • when the VerticalAlignment property is set to ‘Top’ the trimming does work, but this is fairly ugly in case the RowHeight is more than just the bare minimum.

    So the question becomes how to obtain full trimming (character), no wrapping while still being able to use VerticalAlignment ‘Center’ ?

    The enclosed VS 2022 solution highlights the issue

    C1TrueDBGrid Trimming Bug.zip

  • Posted 2 May 2025, 8:26 am EST

    Hi,

    Thanks a lot for sharing the sample project and complete details. We could see the behavior you mentioned. We have reported it to the development team for further investigation and will let you know the updates as soon as possible.

    [Internal Tracking ID: C1WIN-34002]

    Best Regards,

    Kartik

  • Posted 6 May 2025, 7:54 am EST

    Hi,

    According to the development team, the grid functions as expected if the following code, used to force the styles, is removed:

    // force Grid-level Style on DisplayColumns
    foreach (C1DisplayColumn dc in this.c1TruedbGrid1.Splits[0].DisplayColumns)
    	if (dc.Style != null)
    		dc.Style = this.c1TruedbGrid1.Style;

    The team has asked whether there is a specific reason for forcing the styles. Could you please share more details about this requirement so we can investigate further?

    Best Regards,

    Kartik

  • Posted 6 May 2025, 10:25 pm EST

    C1TrueDBGrid Trimming Bug.2025-05-07.zip

    When creating a new C1TrueDBGrid in the Visual Studio designer all DisplayColumns get a new dedicated Style object, making it difficult to easily set the style for ALL columns. In the Visual Studio Designer I haven’t found a way to reset/clear the DisplayColumn Style property so that it would use the default Split or Grid-level Style object (that would be the preferred approach). Is there a way to do that? (apart from by code what I tried)

    In the attached slightly revised solution the setting of the DisplayColumns Style object is skipped, but the ‘name’ DisplayColumn Style property still has ‘VerticalAlignment = Center’, which still leads to the wrong wrapping and wrong trimming behaviour (word trimming).

    If you have a demo solution that uses VerticalAlignment = Center for either the ‘name’ or all DisplayColumns and correct vertical centering + character trimming behaviour I would gladly have a look at it.

  • Posted 9 May 2025, 2:46 am EST

    Hi,

    Apologies for the delay in response.

    Thank you for sharing the updated sample project. We were able to observe the behavior as described and have forwarded all our observations to the development team. We will keep you informed as soon as we receive any updates.

    Best Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels