PC Review


Reply
Thread Tools Rate Thread

DataGrid row height

 
 
Mike
Guest
Posts: n/a
 
      16th Mar 2004
I've looked at a couple of posts about this and Alex's DataGrid Demo, but I
still don't see how to change row height programatically so that long text
will wrap to the next line in a DataGrid. Has anyone been able to do this?
(preferrably in VB)


 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      16th Mar 2004
http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=307

"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've looked at a couple of posts about this and Alex's DataGrid Demo, but

I
> still don't see how to change row height programatically so that long text
> will wrap to the next line in a DataGrid. Has anyone been able to do

this?
> (preferrably in VB)
>
>



 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      16th Mar 2004
Thanks. I used the C# -> VB converter online to convert SetGridRowHeight
to:

Public Sub SetGridRowHeight(dg As DataGrid, nRow As Integer, cy As Integer)
Dim arrRows As ArrayList = CType(dg.GetType().GetField("m_rlrow",
BindingFlags.NonPublic Or BindingFlags.Static Or
BindingFlags.Instance).GetValue(dg), ArrayList)
Dim row As Object = arrRows(nRow)
row.GetType().GetField("m_cy", BindingFlags.NonPublic Or
BindingFlags.Static Or BindingFlags.Instance).SetValue(row, cy)
End Sub 'SetGridRowHeight

but GetValue(dg) is returning Nothing.

Has anyone gotten this to work in VB?


"Alex Feinman [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=307



 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      17th Mar 2004
Perhaps you are trying to invoke this function before you have populated the
grid.
Otherwise you shoud use the SetDefaultGridRowHeight function instead.

"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks. I used the C# -> VB converter online to convert SetGridRowHeight
> to:
>
> Public Sub SetGridRowHeight(dg As DataGrid, nRow As Integer, cy As

Integer)
> Dim arrRows As ArrayList = CType(dg.GetType().GetField("m_rlrow",
> BindingFlags.NonPublic Or BindingFlags.Static Or
> BindingFlags.Instance).GetValue(dg), ArrayList)
> Dim row As Object = arrRows(nRow)
> row.GetType().GetField("m_cy", BindingFlags.NonPublic Or
> BindingFlags.Static Or BindingFlags.Instance).SetValue(row, cy)
> End Sub 'SetGridRowHeight
>
> but GetValue(dg) is returning Nothing.
>
> Has anyone gotten this to work in VB?
>
>
> "Alex Feinman [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=307

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Datagrid Row Height hoffman.adam@gmail.com Microsoft VB .NET 0 5th Sep 2006 10:37 PM
Row height in datagrid =?Utf-8?B?UGhpbGlwIEdlcm1hbm9z?= Microsoft ADO .NET 1 18th Jun 2005 12:01 AM
Row height in datagrid =?Utf-8?B?U2FuZHk=?= Microsoft ASP .NET 1 17th Apr 2005 10:59 AM
DataGrid row height Thomas Wang Microsoft C# .NET 0 7th Sep 2003 05:36 AM
DataGrid.Height Serdar Kalaycý Microsoft ASP .NET 0 28th Jun 2003 01:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:07 AM.