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.

Strange behaviour on column width / row height changes

Thread ID:

Created:

Updated:

Platform:

Replies:

62489 Jun 15,2007 01:35 PM Jun 15,2007 02:24 PM Windows Forms 2
loading
Tags: Grouping
mitul
Asked On June 15, 2007 01:35 PM

Hi,

When I resize the column widths of my gridgroupingcontrol - if I resize so that the width is 0 or negative, the column simply disappears and i cannot bring it back. I have tried to catch the event TableModel.ColWidthsChanging to avoid widths of 0 or negative, but in this particular scenario, the event is not thrown. It is thrown for widths greater than 0.

The same applies for row heights.

Please can you tell me how I can stop resizing of column widths or row heights to 0.

Thanks.

Rajagopal [Syncfusion]
Replied On June 15, 2007 02:20 PM

Hi Mitul,

You need to catch the gridGroupingControl.TableControlResizingColumns event to avoid the columns getting hidden completely when resizing. Below is the code snippet.

void gridGroupingControl1_TableControlResizingColumns(object sender, GridTableControlResizingColumnsEventArgs e)
{
if (e.Inner.Reason == GridResizeCellsReason.MouseUp && e.Inner.Width == 0)
e.Inner.Cancel = true;
}

Similiarly, for rows you could catch the grid.TableControlResizingRows event handler.

Have a nice time.
Regards,
Rajagopal

haneefm [Syncfusion]
Replied On June 15, 2007 02:24 PM

Hi Mitul,

The Resizing of a column can be prevented by handling the TableControlResizingColumns event and setting the e.Inner.Cancel to true. Also the resizing of a row can be prevented by handling the TableControlResizingRows event and setting the e.Inner.Cancel to true.

private void gridGroupingControl1_TableControlResizingColumns(object sender, GridTableControlResizingColumnsEventArgs e)
{
e.Inner.Cancel = true;
}

Best regards,
Haneef

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.

;