We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Setting varying height to grid rows

Hi -

I have data in two columns. Column 2 will have text that could exceed more than 1 line and hence is wrapped.

I would like to set varying height to the rows that have wrapped text so that the entire text is visible.

Intially, I used the following statements to autofit the row height.

// Code Start
Grid1.TableModel.RowHeights.ResizeToFit(GridRangeInfo.Rows(2, Grid1.TableModel.RowCount));
// Code End

But this makes the rows show only the first two lines of the wrapped text (the wrapped text vary from 2 to 10 lines).

Secondly, I tried to set the individual height of the rows based on certain condition using the below code.

//Code Start
Grid1.TableModel.RowHeights.SetSize(2, 100);
Grid1.TableModel.RowHeights.SetSize(3, 400);
//Code End

Here the row 2 is set to a height of 100 and row 3 is set to a height of 400. The moment the second statement is executed, the row 2 also is set to a height of 400.

That is, all the rows in the grid are set to the largest height among the rows.

Can someone explain why is happening? Or am I missing to set any other property?

Thanks
Santhana Gopalan



7 Replies

JJ Jisha Joy Syncfusion Team May 5, 2008 09:26 AM UTC

Hi Santhana Gopalan,

Thank you for posting query to us.

By default, the GridGroupingControl does not support rows with individualized rowheights. To get this support, you need to add a custom GridEngine as in the ResizableRows browser sample( \Essential Studio\6.1.0.34\windows\Grid.Grouping.Windows\Samples\FeatureSamples\ResizableRows ). The ResizableRows browser sample also shows you how to implement the IGridRowHeight interface and its routines for getting and setting row heights for elements.

Please let me know if you have any questions.

Regards,
Jisha



SG Santhana Gopalan Seshasayee May 8, 2008 11:08 AM UTC

Hi Jisha -

Thanks for the inputs. Can you please provide me the exact URL with which I can get the sample on ResizableRows that you've mentioned in your response. Or please send the sample zip file to my email id.

Appreciate your quick response.

Thanks
Santhana Gopalan



JJ Jisha Joy Syncfusion Team May 12, 2008 10:15 AM UTC


Hi Santhana Gopalan,

you can also access the sample from the dashboard in Grid.Grouping.Windows --> FeatureSamples --> ResizableRows

Also I have uploaded the sample here:
ResizableRows.zip

Thank you for using Syncfusion products.
Regards,
Jisha




JH John Hair August 11, 2008 09:58 AM UTC

Hi, looking to use your example to resize the row that the mouse is hovering over, what would be the best way to do that?

Thanks
John



JH John Hair August 11, 2008 10:30 AM UTC

Also, the zip file you posted appears to be invalid.



JH John Hair August 11, 2008 11:43 AM UTC

Ok, got individual resizing of rows to work with a mouse over.

New question though, if I set the row heights on several rows the screen updates after each SetRange, is there a way to suspend the updates so they all redraw together? GGC.SuspendUpdates() ResumeUpdates() doesn't help.

Thanks
John



NA Nisha Arockiya A Syncfusion Team August 12, 2008 10:14 AM UTC

Hi John,

Thank you for posting query to us.It is not possible to use gridGroupingControl.ResumeUpdates() and gridGroupingControl.SuspendUpdates().

Please provide with more information, so that we can clarify your doubt.

Regards,
Nisha



>Ok, got individual resizing of rows to work with a mouse over.

New question though, if I set the row heights on several rows the screen updates after each SetRange, is there a way to suspend the updates so they all redraw together? GGC.SuspendUpdates() ResumeUpdates() doesn't help.

Thanks
John




Loader.
Live Chat Icon For mobile
Up arrow icon