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

Set minimum range to column with of a grid

Hi,

when i resizing the column of a grid by click and drag the column header , its disappearing when the size reaching zero. and it is not possible to get the clolumn back.
So how can I set a minimum and maximum width range to grid column.?
All helps are appreciable.

Thanks
Ali PP


1 Reply

JJ Jisha Joy Syncfusion Team March 23, 2009 04:43 AM UTC

Hi Alipalengara,

Actually when you resize the column using mouse and make it hidden, you can bring back that column just by double clicking on the column seperator as the resize indicator appears.

If you want to avoid column being hidden as you resize, then you can hook to the TableControlResizingColumns event of the GridGroupingControl that gets triggered when columns in grid are resized. In the event handler code, check for the width of the column that is resized and cancel the event if its hidden(width=0).

void gridGroupingControl1_TableControlResizingColumns(object sender, GridTableControlResizingColumnsEventArgs e)
{
if ((e.Inner.Reason == GridResizeCellsReason.MouseMove || e.Inner.Reason == GridResizeCellsReason.MouseUp)
&& e.Inner.Width == 0)
{
// set e.Inner.Cancel to true to avoid column being hidden
//e.Inner.Cancel = true;
Console.WriteLine("Column Hidden");
}
}

Let me know if you have any other questions.

Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon