Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1210
Label text max lines
posted

Hi,
I want to set label text to wrap but label should contain max two lines. Is there any way other than explicitly setting height of label presenter.

Thanks.

  • 138253
    Offline posted

    Hello,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I created a Style for the labelPresenter and set its ContentTemplate to be a Textbox. I make it look like the default Label and set its MaxLines Property to 2. I also set the XamDataGrid’s LabelMinWidth Property to 52, which the min size for showing two full lines, but if you want you can remove it based on your requirements. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamDataGridLabelMaxLines.zip