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

Allow user to resize column when row zero is hidden?

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.

3 Replies

AD Administrator Syncfusion Team 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;
		}
	}
}


AD Administrator Syncfusion Team 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;
>		}
>	}
>}
>


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon