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
260
How to display multiline text as only one line?
posted

I have an UltraGrid that needs to display data that contains end line characters. Instead of the row getting taller to display all the text, i would like it to not render the end line characters at all, so that all the text is on one line. It would be preferable if I could define this by column.

Otherwise I will have modify the data after it is read from the database, which I would rather not do.


Thank you for your help,

bruestle2

  • 469350
    Offline posted

    Hi,

    So you have text with line break in it and you want to show all of the text on one line in the grid?

    I don't beleive there are any property settings that will allow you to do this.

    You could hide the real column of data and add an unbound column to the grid which would display what you want to the user. So you handle the InitializeLayout event of the grid, set the Hidden property on the column to true, then add an unbound string column. In the InitializeRow event of the grid, you get the value of the hidden column, strip out the NewLine characters (perhaps replace them with spaces) and populate the unbound column's Value with the new string.