UltraGrid Row Height

Answered (Not Verified) This post has 0 verified answers | 9 Replies | 5 Followers Thread's RSS feed.

mittalnarinder
Points 235
Replied On: Tue, May 26 2009 4:14 AM Reply

Hi

There is requirement for settting the row height of ultragrid to three times the default height. Also if the text doesn't fit into the available width and height, then it should show the ellipsis at end and show full text in the tooltip on grid cell

As far I know that I can either set the row to autosize according to the length of text or can set the elipsis to show grid cell. But I don't know how can I set the both at one time

Thanks

Narinder

  • Post Points: 20

All Replies

Replied On: Tue, May 26 2009 7:29 AM Reply

Hello Narinder.

In order to set the height of the row you can use:

ultraGrid1.DisplayLayout.Override.RowSizingAutoMaxLines = 3;

in addition to

this.ultraGrid1.DisplayLayout.Override.RowSizing = RowSizing.AutoFree;

 

ultraGrid1.DisplayLayout.Override.CellMultiLine =

DefaultableBoolean.True;

but when you are using CellMultiLine you can't set TextTrimming since the text isn't actually trimmed it simply not visualized. In order to have the ellipsis character you'll have to provide your own logic.

Sincerely,

Petar Monov

Developer Support Engineer,

Infragistics, Inc

 

 

Sincerely,
Petar, MCTS
Software Developer 
Infragistics
www.infragistics.com\support

  • Post Points: 35
Gianni
Points 1,149
Replied On: Fri, Sep 24 2010 5:50 AM Reply

Petar,

please could you provide an example  of logic able to put ellipsis in the last row visualized, when working with CellMultiLine ?

Thanks in advance.

Gianni

 

  • Post Points: 20
Mike Saltzman
Points 444,270
Infragistics Employee
Answered (Not Verified) Replied On: Fri, Sep 24 2010 10:32 AM Reply
Suggested by Gianni

Hi Gianni,

I don't think this is possible, but if it is, it would be via the TextTrimming property on the appearance.

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Gianni
Points 1,149
Replied On: Fri, Sep 24 2010 11:27 AM Reply

Hi Mike!

Yes it was enough to set TextTrimming property to obtain ellipsis char at the end of last displayed line!

I think Petar was talking about something else !

Thank you very much

 Gianni

  • Post Points: 5
Mitchster2
Points 475
Replied On: Mon, Dec 12 2011 2:42 PM Reply

Ka ching!!!

Just exactly what i needed:

ultraGrid1.DisplayLayout.Override.RowSizingAutoMaxLines = 3;

 

Using it in the Initialize Row event with the grid set to auto free and a quick test of the count of "vbcrlf"s in my multiline column  and you get ...

Dynamic Row Heights

 

Thanks,


  • Post Points: 20
Mike Saltzman
Points 444,270
Infragistics Employee
Replied On: Tue, Dec 13 2011 9:35 AM Reply

Hi,

Setting this in InitializeRow is a bit odd, since that event fires for each row. InitializeLayout would make more sense. :)

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Mitchster2
Points 475
Replied On: Tue, Dec 13 2011 11:16 AM Reply

If I set it on InitializeLayout then all of the rows would be set, wouldn't they?

In my grid initialization I have:

(I go through the bands because I have Custom grid settings loading on Form Load)

 

                ''*********************************************************************************

                ''FIELDS WITH SPECIAL FORMATTING NEEDS

                ''*********************************************************************************

                For xr = (.Bands.Count - 1) To 0 Step -1

                    For m As Integer = 0 To .Bands(xr).Columns.Count - 1

                        Select Case .Bands(xr).Columns(m).Key

                            Case "myHappyField"

                                .Bands(xr).Columns("myHappyField").CellMultiLine = DefaultableBoolean.True

                                .Bands(xr).Columns("myHappyField").VertScrollBar = True

                        End Select

                    Next

                Next

 

                'then I am setting the grid to Auto free

                .Override.RowSizing = UltraWinGrid.RowSizing.AutoFree

 

Just need the 'magical jelly bean' to make it automatically expand those rows with the multilines filled.

 

 

  • Post Points: 5
Mitchster2
Points 475
Replied On: Wed, Dec 14 2011 8:15 AM Reply

After adding my muliline data I just needed to ...

selectedCell.Row.Cells("myHappyField").Column.PerformAutoResize()

 

 

  • Post Points: 5
Mitchster2
Points 475
Replied On: Fri, Dec 16 2011 11:52 AM Reply

and do the autoresize on the row, too.

  • Post Points: 5
Page 1 of 1 (10 items) | RSS