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

Allow user to resize column when row zero is hidden?

Thread ID:

Created:

Updated:

Platform:

Replies:

16620 Jul 21,2004 03:58 AM UTC Jul 21,2004 11:53 AM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 21, 2004 03:58 AM UTC

I want to hide the row/column id''s that display in row zero and column zero respectively. To that end, I have hidden row zero using both Me.GridControl1.HideRows(0) = True and Me.GridControl1.Rows.Hidden(0) = True However, now the user is unable to resize the columns at runtime. How can I enable column resizing when row zero is hidden? Or, what is the preferred method suppressing the row/column id''s? Thanks, s.s.

Administrator [Syncfusion]
Replied On July 21, 2004 04:59 AM UTC

By default in a GridControl, if you place the cursor over the header border where the hidden column is, and you double click it, the hidden column will resize to what it was before it was hidden. In a GridDataBoundGrid, this behavior is not there by default. But you can add it by handling the ResizingColumns event.
private void gridDataBoundGrid2_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
	int right = e.Columns.Right;
	GridDataBoundGrid grid = sender as GridDataBoundGrid;
	if(right < grid.Model.ColCount)
	{
		if(grid.Model.Cols.Hidden[right+1] && e.Reason == GridResizeCellsReason.DoubleClick)
		{
			grid.Model.Cols.Hidden[right+1] = false;
			e.Cancel = true;
		}
	}
}

Administrator [Syncfusion]
Replied On July 21, 2004 11:21 AM UTC

So, in other words, the USER cannot resize a column at runtime, unless row zero is visible? Thanks, s.s. >By default in a GridControl, if you place the cursor over the header border where the hidden column is, and you double click it, the hidden column will resize to what it was before it was hidden. > >In a GridDataBoundGrid, this behavior is not there by default. But you can add it by handling the ResizingColumns event. >
>private void gridDataBoundGrid2_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
>{
>	int right = e.Columns.Right;
>	GridDataBoundGrid grid = sender as GridDataBoundGrid;
>	if(right < grid.Model.ColCount)
>	{
>		if(grid.Model.Cols.Hidden[right+1] && e.Reason == GridResizeCellsReason.DoubleClick)
>		{
>			grid.Model.Cols.Hidden[right+1] = false;
>			e.Cancel = true;
>		}
>	}
>}
>

Administrator [Syncfusion]
Replied On July 21, 2004 11:53 AM UTC

>>So, in other words, the USER cannot resize a column at runtime, unless row zero is visible? No. You can set the InsideGrid flag in the grid.ResizeColsBehavior property to allow resizing on any cell border.

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

;