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.

GGC: Manually setting row height to 0

Thread ID:

Created:

Updated:

Platform:

Replies:

40772 Feb 13,2006 09:20 AM Nov 24,2008 07:17 AM Windows Forms 7
loading
Tags: GridControl
Brian Corley
Asked On February 13, 2006 09:20 AM

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?

stanleyj [Syncfusion]
Replied On February 14, 2006 01:38 AM

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

Administrator [Syncfusion]
Replied On February 21, 2006 04:27 PM

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).

stanleyj [Syncfusion]
Replied On February 21, 2006 11:56 PM

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

Administrator [Syncfusion]
Replied On February 22, 2006 10:17 AM

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.

Administrator [Syncfusion]
Replied On February 22, 2006 03:54 PM

I have moved this issue to Direct-Trac

Suhail Shaikh
Replied On November 11, 2008 05:23 AM

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


Nisha Arockiya A [Syncfusion]
Replied On November 24, 2008 07:17 AM

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


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.

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.

;