Home All Groups Group Topic Archive Search About

Multi line grid row with .net compact framework 2.0

Author
20 Nov 2006 1:24 PM
Christian Philippart
Hi,

How can I adjust the row height in a grid with multiple lines in a row?

Thank you

Christian.

Author
20 Nov 2006 7:03 PM
RobinS
Web Forms or Window Forms?

Robin S.
-------------------
Show quoteHide quote
"Christian Philippart" <Christian Philipp***@discussions.microsoft.com>
wrote in message news:91A2E74E-6BEF-42D8-8A4F-11C9BB42EF61@microsoft.com...
> Hi,
>
> How can I adjust the row height in a grid with multiple lines in a row?
>
> Thank you
>
> Christian.
Author
20 Nov 2006 7:16 PM
Christian Philippart
Windows Forms

Show quoteHide quote
"RobinS" wrote:

> Web Forms or Window Forms?
>
> Robin S.
> -------------------
> "Christian Philippart" <Christian Philipp***@discussions.microsoft.com>
> wrote in message news:91A2E74E-6BEF-42D8-8A4F-11C9BB42EF61@microsoft.com...
> > Hi,
> >
> > How can I adjust the row height in a grid with multiple lines in a row?
> >
> > Thank you
> >
> > Christian.
>
>
>
Author
20 Nov 2006 7:35 PM
RobinS
This is from "Pro .Net 2.0 Windows Forms and Custom Controls in VB2005"
by Matthew MacDonald.

You set the columns that you want to wrap. Then you set the column width.
Then you use automatic row resizing to heighten the row to fit all the text.

Here's an example that ensures you can always see the full description text.
The Description column is set to use DataGridViewAutoSizeColumnMode.Fill,
and the automatic row size adjusts the row height as necessary.

Dim colDesc as DataGridViewColum = dataGridView1.Columns("Description")

'Give it as much width as possible
colDesc.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill

'Wrap to fit the bounds of the column
colDesc.DefaultCellStyle.WrapMode = DataGridViewTriState.True

'Use row autosizing to show all the text
dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells

If you use AllCell instead of DisplayedCells, it will do all of the cells in
the grid; this
will result in more lethargic performance.

I think you can also use DataGridView styles. If this doesn't work, repost
and
hopefully if I don't have time to research it, someone else will.

Good luck.
Robin S.


Show quoteHide quote
"Christian Philippart" <ChristianPhilipp***@discussions.microsoft.com> wrote
in message news:038A75EC-DBEC-445A-937A-6C1DDD46DCB1@microsoft.com...
>
> Windows Forms
>
> "RobinS" wrote:
>
>> Web Forms or Window Forms?
>>
>> Robin S.
>> -------------------
>> "Christian Philippart" <Christian Philipp***@discussions.microsoft.com>
>> wrote in message
>> news:91A2E74E-6BEF-42D8-8A4F-11C9BB42EF61@microsoft.com...
>> > Hi,
>> >
>> > How can I adjust the row height in a grid with multiple lines in a row?
>> >
>> > Thank you
>> >
>> > Christian.
>>
>>
>>
Author
20 Nov 2006 9:01 PM
Christian Philippart
Thank you Robin


Show quoteHide quote
"RobinS" wrote:

> This is from "Pro .Net 2.0 Windows Forms and Custom Controls in VB2005"
> by Matthew MacDonald.
>
> You set the columns that you want to wrap. Then you set the column width.
> Then you use automatic row resizing to heighten the row to fit all the text.
>
> Here's an example that ensures you can always see the full description text.
> The Description column is set to use DataGridViewAutoSizeColumnMode.Fill,
> and the automatic row size adjusts the row height as necessary.
>
> Dim colDesc as DataGridViewColum = dataGridView1.Columns("Description")
>
> 'Give it as much width as possible
> colDesc.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
>
> 'Wrap to fit the bounds of the column
> colDesc.DefaultCellStyle.WrapMode = DataGridViewTriState.True
>
> 'Use row autosizing to show all the text
> dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells
>
> If you use AllCell instead of DisplayedCells, it will do all of the cells in
> the grid; this
> will result in more lethargic performance.
>
> I think you can also use DataGridView styles. If this doesn't work, repost
> and
> hopefully if I don't have time to research it, someone else will.
>
> Good luck.
> Robin S.
>
>
> "Christian Philippart" <ChristianPhilipp***@discussions.microsoft.com> wrote
> in message news:038A75EC-DBEC-445A-937A-6C1DDD46DCB1@microsoft.com...
> >
> > Windows Forms
> >
> > "RobinS" wrote:
> >
> >> Web Forms or Window Forms?
> >>
> >> Robin S.
> >> -------------------
> >> "Christian Philippart" <Christian Philipp***@discussions.microsoft.com>
> >> wrote in message
> >> news:91A2E74E-6BEF-42D8-8A4F-11C9BB42EF61@microsoft.com...
> >> > Hi,
> >> >
> >> > How can I adjust the row height in a grid with multiple lines in a row?
> >> >
> >> > Thank you
> >> >
> >> > Christian.
> >>
> >>
> >>
>
>
>