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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGrouping - How to hide the column?

Thread ID:

Created:

Updated:

Platform:

Replies:

49197 Sep 13,2006 07:30 AM UTC Feb 11,2016 12:05 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 13, 2006 07:30 AM UTC

hi!

how to hide a specific column of the grid?
I want to get the value of the hidden column when user click on any cell of the row.

My grid is allowed to Group.

Thanks!

Administrator [Syncfusion]
Replied On September 13, 2006 09:08 AM UTC

Hi Lim,

Use the VisibleColumns property of the GridTableDescriptor to show / hide / move the columns in the grid. Below is a code snippet

//For hide the "Col0" column
this.grid.TableDescriptor.VisibleColumns.Remove("Col0");

//For show the "Col0" column
this.grid.TableDescriptor.VisibleColumns.Add("Col0");

//For move columns in a grid.
this.grid.TableDescriptor.VisibleColumns.Move(1,2);

To get the value of the hidden column, you need to call the Record.GetValue method in TablecontrolCellClick event.

GridRecordRow recRow = e.TableControl.Table.DisplayElements[e.Inner.RowIndex] as GridRecordRow;
if(recRow != null)
{
Console.WriteLine(recRow.ParentRecord.GetValue("Col0") );
}


Thanks,
Haneef

QLT User
Replied On February 10, 2016 02:55 PM UTC

how do i move the column if i dont know its current position ? is there a way to get its current position and then use variables in the move method ?

Pavithra Kodiyarasan [Syncfusion]
Replied On February 11, 2016 12:05 PM UTC

Dear Customer,

Thank you for contacting Syncfusion Support.

You can get current position of the column by using IndexOf() method and move the column by Move() method. Please find the Code example and sample below.

Code Example:

int columnindex = this.gridGroupingControl1.TableDescriptor.Columns.IndexOf("Name"); //get the Column index of column "Name"

this.gridGroupingControl1.TableDescriptor.Columns.Move(columnindex, 0); //Move the column to zero index.

Sample:


http://www.syncfusion.com/downloads/support/forum/49197/ze/WindowsFormsApplication1-63976165 


Regards,

Pavithra K.


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.

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

;