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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to hide column on mouse right button click

Thread ID:





55439 Jan 30,2007 01:36 PM UTC Feb 1,2007 07:01 PM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On January 30, 2007 01:36 PM UTC

I need to hide/unhide column on mouse click on menu.

How to do?

Administrator [Syncfusion]
Replied On January 31, 2007 12:03 AM UTC

In a GridControl or GridDataBoundGrid, you can you code like:

grid.Model.Cols.Hidden[colIndex] = true;

to hide a column.

In a GridGroupingControl, you use code like:


Administrator [Syncfusion]
Replied On February 1, 2007 12:01 PM UTC

Thanks for details...

Actually i want 2 functionalities hide columns and delete columns from the grid...
User can unhide the earlier hiden column but should not get deleted column back....

How to achieve these 2 functionalities and unhide the column

Administrator [Syncfusion]
Replied On February 1, 2007 07:01 PM UTC


Issue 1: Hide/Unhide the column:

In a GridControl or GridDataBoundGrid, A column can be hidden or unhidden by just setting the this.gridControl1.Cols.Hidden[colIndex] = true;
and this.gridControl1.Cols.Hidden[colIndex] = false; respectively.

In a GridGroupingControl, you use the VisibleColumns property of the GridTableDescriptor to show / hide the columns in the grid. Below is a code snippet

//For hide the "Col0" column

//For show the "Col0" column

Issue 2: Remove the column from the grid.

In a GridControl, the column can be removed by calling the gridControl1.Model.Cols.RemoveRange(from,to);

In a GridDataBoundGrid or GridGroupingControl, column can be removed by using the underlying datasource of the grid. Here is a code.

DataTable dt = grid.DataSource as DataTable;

Best Regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon