Posted By: Another_Darren | Dec 5th, 2006 @ 7:21 AM
page 1 of 1
Comments: 3 | Views: 4741
Another_Darren
Another_Darren
... than you can shake a stick at
I'm loading a DataGridView with some log data and 90% of the line each log entry is one line only. But in some cases, such as logging error output, I have 4 or 5 lines.  I want to display each row at the correct height for it's content, for example...


+-------------------------------------------------------+
| Logged    | Message                                   |
+-------------------------------------------------------+
| Tue 12:15 | some text                                 |
+-------------------------------------------------------+
| Tue 12:16 | error message                             |
|           | ...more text                              |
|           | ...and more                               |
+-------------------------------------------------------+
| Tue 12:18 | error message                             |
|           | ...more text                              |
+-------------------------------------------------------+
| Tue 12:19 | some text                                 |
+-------------------------------------------------------+


Is this possible?
odujosh
odujosh
Need Microsoft SUX now!
Yes Either:
Used Bound Columns instead of autogenerate columns and then set width as you like.
-or-
use templated field. Change the width of the Label control to desired width and set wrap to true in the Templated Field for column 2. Wala the text will wrap.

You can even change the templated approach so the text is in a div that has a vertical scroll bar if you want to force height. The template can contain any combo of controls.

The Wizard leads you through either process or you can use intellisense.
page 1 of 1
Comments: 3 | Views: 4741