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. Image for the cookie policy date

How to hide columns in GridListControl

Hi,

I got GridListControl which placed inside GridGroupingControl.
I bind the grid with DataSource as followed:

private void gridGrpCtrlAssignEmps_TableControlCurrentCellActivated(object sender, GridTableControlEventArgs e)
{
GridDropDownGridListControlCellRenderer dropDownRenderer = cc.Renderer as GridDropDownGridListControlCellRenderer;

if (dropDownRenderer != null)
{
if (column.Name == this.m_Dictionary["SignIn"])
{
GridListControl listControlSignIn = dropDownRenderer.ListControlPart;
listControlSignIn.DataSource = this.getClockSignList(clockSignList, "SignIn");
listControlSignIn.DisplayMember = this.m_Dictionary["SignIn"];
listControlSignIn.ValueMember = this.m_Dictionary["SignIn"];

listControlSignIn.Click += new EventHandler(listControlSignIn_Click);
}}

I would like to hide some of the binded columns when the drop down is opened.
How can it be achived?

1 Reply

RC Rajadurai C Syncfusion Team January 11, 2010 01:39 PM UTC

Hi Ruslan,

Thanks for your interest in Syncfusion Products.

To hide some of the columns in the dropdownlist while showing, you can make use of the HideCols of the Grid through the ListControlPart object. Here is the code that can be handled in TableControlCurrentCellActivated event for your reference.

GridCurrentCell cc = e.TableControl.CurrentCell;
GridDropDownGridListControlCellRenderer rend = cc.Renderer as GridDropDownGridListControlCellRenderer;
GridDropDownGridListControlPart part = rend.ListControlPart as GridDropDownGridListControlPart;
part.DataSource = listTable();
part.DisplayMember = "State";
part.ValueMember = "City";
part.Grid.HideCols[3] = true; //code used to hide certain column in dropdownlist


Regards,
Rajadurai

Loader.
Live Chat Icon For mobile
Up arrow icon