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.

Not allow hiding of columns

Thread ID:





81902 May 22,2009 02:40 PM May 26,2009 01:45 AM Windows Forms 1
Tags: GridControl
Csermák András
Asked On May 22, 2009 02:40 PM

Dear All,

I tried not to allow the hiding of columns as suggested in http://www.syncfusion.com/support/forums/grid-windows/15563/ColWidthsChanged%20not%20getting%20called but the "e.Cancel=true" setting of the ColsHiding event argument parameter does not work in my application. The columns can be hidden by mouse if their size is moved to 0. Have you any idea, how could I solve this problem? Should I set any other propety too?

Thanks in advance for the answers!

Rajadurai C [Syncfusion]
Replied On May 26, 2009 01:45 AM

Hi Andras,

Thanks for your interest in Syncfusion products.

The code handled in ColsHiding event works as expected in our side.

void Model_ColsHiding(object sender, Syncfusion.Windows.Forms.Grid.GridRowColHidingEventArgs e)
if (e.From >= 2 && e.To <= 3)
e.Cancel = true;

If you still sees the issue, please try the following alternative solution handled in ResizingColumns event to prevent resizing column width to zero at runtime.

//in Form1_Load()
this.gridControl1.ResizingColumns += new GridResizingColumnsEventHandler(gridControl1_ResizingColumns);

//gridControl1_ResizingColumns method
void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
if (e.Reason == GridResizeCellsReason.MouseUp)
if (e.Width == 0)
e.Cancel = true;

This also doesn't allow the column to be resized to width 0.



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.