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.

Set minimum range to column with of a grid

Thread ID:

Created:

Updated:

Platform:

Replies:

80213 Mar 20,2009 07:36 AM Mar 23,2009 12:43 AM Windows Forms 1
loading
Tags: GridControl
ali
Asked On March 20, 2009 07:36 AM

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


Jisha Joy [Syncfusion]
Replied On March 23, 2009 12:43 AM

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


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.

;