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

GGC: Manually setting row height to 0

I have looked at the sample. Essential Studio\3.3.0.0\Windows\Grid.Windows\Samples\Grouping\ResizableRows and still need some help. I need a way to be able to manually iterate the records in a grid (tables and nested tables) and set the rowheight = 0 (essentially hiding certain rows). Can I do this?

7 Replies

ST stanleyj Syncfusion Team February 14, 2006 06:38 AM UTC

Hi Brian, Yes, here is a simple code below to hide the 6th row. private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if(e.TableCellIdentity.RowIndex == 6) { ((IGridRowHeight) e.TableCellIdentity.DisplayElement).RowHeight = 0; } } Couple of related threads are http://www.syncfusion.com/support/forums/message.aspx?MessageID=38251 http://www.syncfusion.com/support/forums/message.aspx?MessageID=39852 Best regards, Stanley


AD Administrator Syncfusion Team February 21, 2006 09:27 PM UTC

I have tried doing this with a grid that has a large number of rows and when you scroll the display gets all messed up (if there are rows set with a zero height).


ST stanleyj Syncfusion Team February 22, 2006 04:56 AM UTC

Hi Chuck, If an user resizes a row height to be 0, then the row will be hidden but that will not affect the height of the grid. The code below disables this default behavior and instead will set the height of the rows to be 0. this.gridGroupingControl1.TableControlResizingRows += new GridTableControlResizingRowsEventHandler(gridGroupingControl1_TableControlResizingRows); void gridGroupingControl1_TableControlResizingRows(object sender, GridTableControlResizingRowsEventArgs e) { if (e.Inner.Reason == GridResizeCellsReason.MouseUp) { e.TableControl.Model.RowHeights.SetRange(e.Inner.Rows.Top, e.Inner.Rows.Bottom, e.Inner.Height); e.Inner.Cancel = true; } else if (e.Inner.Reason == GridResizeCellsReason.DoubleClick) { e.TableControl.Model.RowHeights.SetRange(e.Inner.Rows.Top, e.Inner.Rows.Bottom + 1, -1); // back to default size. e.Inner.Cancel = true; } } Let me know if you are experiencing a different behavior. Best regards, Stanley


AD Administrator Syncfusion Team February 22, 2006 03:17 PM UTC

Well it is not the user I am changing the row height to zero for certains rows that have no data. Basically I have a multi-row display with one row being comments. If there are no comments then I had that row from the two row record. If any of these are hidden then scrolling does not work properly. Using the wheel mouse it works however the painting becomes messed up, same with clicking in the scroll area. However if you click in on the up or down scroll arrow in the scroll area only the first click moves anything then future clicks are ignored (unless you go the other direction then you get one click again). This happens when I change the row size to anything other than the default (not just zero). I have tried changing to 5 or double the normal size. As long as several rows have changed size then the painting becomes distorted and the arrows on the scroll area do not function properly.


AD Administrator Syncfusion Team February 22, 2006 08:54 PM UTC

I have moved this issue to Direct-Trac


SS Suhail Shaikh November 11, 2008 10:23 AM UTC

Hi,

Can I know the Direct Trac incident number of this? I am also facing similar issue so would like to know the resolution. I would appreciate if you can post the resolution from Direct-Trac here.

Thank you.


>I have moved this issue to Direct-Trac



NA Nisha Arockiya A Syncfusion Team November 24, 2008 12:17 PM UTC

Hi Developer,

Sorry for the delay in getting back to you.

I have searched through the DirectTrac and could not find such incident.

Could you please provide your sample with issue reproduced in it??

For your reference: The Attached sample demonstrates the feature resizing individual rows in the grid. It also implements the IGridRowHeight interface and its routines for getting,setting and preventing row height for elements. Please find the sample below.

Here is a sample
http://www.syncfusion.com/Support/user/uploads/GGCAutoHeightAndResize_d6770c54.zip

For more details, See the ResizableRows browser sample.
Syncfusion\Essential Studio\4.2.0.37\windows\Grid.Grouping.Windows\Samples\ResizableRows\

Regards,
Nisha


Loader.
Live Chat Icon For mobile
Up arrow icon