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.
Syncfusion Feedback

Hiding GLC Column issue

Thread ID:

Created:

Updated:

Platform:

Replies:

61064 May 17,2007 12:08 PM UTC May 17,2007 07:27 PM UTC Windows Forms 1
loading
Tags: GridControl
John Slater
Asked On May 17, 2007 12:08 PM UTC

I'm having an issue hiding a GLC column. I have a GDBG with two GLC's. If I hide a GLC column by it's Mapping Name, it is hiding the same column position on the second GLC. I have an example attached.

GLC_Issue_Project.zip

Saravanan A [Syncfusion]
Replied On May 17, 2007 07:27 PM UTC

Hi JMS,

The embedded grid in the GridListControl will maintain the HiddenColumnEntries based on the column index. So whenever you hide any column with a mapping name, it will find the corresponding column index and make an entry in the HiddenColumnEntries collection. And another fact is that all the GridListControl cells will refer to a same GridListControl object and that GridListControl will get populated just before dropdown window opens. This is the reason for the behavior you have seen.

To over come this, you would have to subscribe to the CurrentCellShowingDropDown event. And in that event handler reset all the hidden column and then selectively hide the columns based on the mapping name.

Please try the following code snippet and let me know if this helps.

void gridDataBoundGrid1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridDropDownGridListControlCellRenderer cr = this.gridDataBoundGrid1.CurrentCell.Renderer as GridDropDownGridListControlCellRenderer;

if (cr != null)
{
//Resetting all the hidden columns
int colCount = cr.ListControlPart.Grid.Model.ColCount;
cr.ListControlPart.Grid.Model.HideCols.ResetRange(1, colCount);

GridCurrentCell cc = gridDataBoundGrid1.CurrentCell;
int field = gridDataBoundGrid1.Binder.ColIndexToField(cc.ColIndex);
GridBoundColumn column = gridDataBoundGrid1.Binder.InternalColumns[field];

//Hiding selective columns
if (column.MappingName == "mrh_RecID")
{
cr.ListControlPart.Grid.Model.HideCols["mrh_RecID"] = true;
}
}
}


Best Regards,
Saravanan.

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

;