C1DataGrid TextTrimming and ToolTip

Posted by: gregor.sch on 10 November 2019, 11:11 pm EST

    • Post Options:
    • Link

    Posted 10 November 2019, 11:11 pm EST

    Hi,

    I’m working on an app which uses many instances of C1DataGrid in numerous forms and UserControls. The entire styling and templating is implemented with ResourceDictionaries. I’m trying to enable TextTrimming for C1DataGridTextColumns (and display ToolTips if TextTrimming occurs), tried everything I could think of, but ran out of ideas.

    What’s the correct way to enable this globally (from the style definitions in my ResourceDictionary)?

    Thanks and best regards,

    G

  • Posted 14 November 2019, 4:19 pm EST

    Hello Gregor,

    Changing the TextTrimming property for DataGridTextColumn by style is not possible. You can, however, achieve the same by code.

    Let me know if you are fine with a solution using the code-behind approach.

    ~Ruchir

  • Posted 17 November 2019, 11:19 pm EST

    Hi Ruchir,

    A code-behind solution would only work, if it can be implemented globally from a centralized location (e.g. the code-behind in a resource dictionary).

    Calling a method from every single form or usercontrol sounds even more painful than manually assigning the property where needed.

    If you have a working sample, please post it here so I can review it and apply it to my project, if applicable.

    Thanks,

    G

  • Posted 18 November 2019, 11:05 pm EST

    Hello,

    We cannot change TextTrimming for DataGridTextColumn by Style. Therefore, please find attached the application implementing requirement through code.

    ~Ruchir

    DataGridSample.zip

Need extra support?

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

Learn More

Forum Channels