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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Setting varying height to grid rows

Thread ID:

Created:

Updated:

Platform:

Replies:

73308 Apr 30,2008 12:40 PM UTC Aug 12,2008 10:14 AM UTC Windows Forms 7
loading
Tags: GridControl
Santhana Gopalan Seshasayee
Asked On April 30, 2008 12:40 PM UTC

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



Jisha Joy [Syncfusion]
Replied On 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


Santhana Gopalan Seshasayee
Replied On 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


Jisha Joy [Syncfusion]
Replied On 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



John Hair
Replied On 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


John Hair
Replied On August 11, 2008 10:30 AM UTC

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


John Hair
Replied On 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


Nisha Arockiya A [Syncfusion]
Replied On 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




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;