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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hidden/visible rows/cols in GridRangeInfoList format + autoresize

Thread ID:

Created:

Updated:

Platform:

Replies:

30003 Jun 8,2005 06:44 PM UTC Jun 14,2005 01:01 PM UTC WinForms 8
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 8, 2005 06:44 PM UTC

Hi, all! I''m constructing a hierarchical grid like in the sample ''Grid.Windows\Samples\In Depth\VirtTreeGrid''. I want to autoresize the columns but I haven''t found, how. Then I wanted to get the viewed rows in GridRangeInfoList format in order to control selections but only the Set/GetRange() method exists using Boolean[]. Do you plan to expand GridRangeInfoList with a static method that converts such a boolean array to a GridRangeInfoList? Thx: Gergely Varadi

Administrator [Syncfusion]
Replied On June 9, 2005 01:15 AM UTC

1) That sample has a gridControl1.QueryColWidth event handler that prevents any col width sizing, so your user cannot change the widths and grid.ColWidths.ResizeToFit does not work. If you comment out, your user can change the col widths and you can call ResizeToFit to size a specified range. If you want the ResizeToFit to work properly on your tree cell, you will have to add a CalculatePreferredCellSize override in teh cell model class, call the baseclass, and then increase the width based on the indent needs. 2) We haven''t had this request before. I will forward it to the grid architect.

Administrator [Syncfusion]
Replied On June 9, 2005 07:23 AM UTC

Then please include a ResizeToFit(GridRangeInfoList range) method, as hidden rows should normally not count in an automatic resize process.

Administrator [Syncfusion]
Replied On June 9, 2005 09:53 AM UTC

If you use code like this.grid.Model.Cols.Hidden[2] = true; to hide the columns, then grid.Model.ColWidths.ResizeToFit should not affect them.

Administrator [Syncfusion]
Replied On June 9, 2005 02:39 PM UTC

Yes, I saw this feature. Question is, if GridResizeToFitOptions.NoShrinkSize is not set and I have hidden rows, why ResizeToFit() does not shrink the column?

Administrator [Syncfusion]
Replied On June 9, 2005 05:18 PM UTC

I think this is a problem. Putting this code in a button handler, does not work unless you comment out the Hidden line. this.gridDataBoundGrid1.Model.Rows.Hidden[3] = true; this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Table()); I have forwarded this to the grid architect to see if I am overlooking something, but this does seem to be a defect.

Administrator [Syncfusion]
Replied On June 14, 2005 12:07 PM UTC

Say row3, row4, row5 is hidden. If I doubleclick on the line between row2 and row6, these hidden lines get visible and GridModel_RowsHiding/Hidden get called. For each line separately, however, it is capable to handle this functionality by the ''From'' and ''To'' parameters in ''GridRowColHidingEventArgs''. It is important for me, because I must not let the user view a single row, only row groups denoting a whole subtree. (I''m still speaking about the tree logic in ''Grid.Windows\Samples\In Depth\VirtTreeGrid'')

Administrator [Syncfusion]
Replied On June 14, 2005 12:43 PM UTC

Do you want to avoid the display of hidden rows through the doubleclick? If so, you can try handling the ReisizingRows event.
private void gridControl1_ResizingRows(object sender, GridResizingRowsEventArgs e)
{
	if(e.Reason == GridResizeCellsReason.DoubleClick)
	{
		e.Cancel = true;
	}
}

Administrator [Syncfusion]
Replied On June 14, 2005 01:01 PM UTC

This support is amazing fast, thx again.

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

;