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.

Gridgroupingcontrol and hidecols

Thread ID:

Created:

Updated:

Platform:

Replies:

54404 Jan 8,2007 12:49 PM Jan 9,2007 01:02 PM Windows Forms 3
loading
Tags: GridControl
Ray
Asked On January 8, 2007 12:49 PM

I have a gridgroupingcontrol with 28 columns. I am trying to hide and unhide a column. I can hide the column fine but it will not reappear if I set hidecols to false.

I am using 4.4.046.

Should I send a sample?

Thanks

Ray


private void buttonAdv1_Click(object sender, EventArgs e)
{
_Grid.TableControl.Model.HideCols["a"] = true;

}

private void buttonAdv2_Click(object sender, EventArgs e)
{
_Grid.BeginUpdate();
_Grid.TableControl.Model.HideCols["a"] = false;
_Grid.EndUpdate(true);
_Grid.Refresh();
}

Babu Chella Velu [Syncfusion]
Replied On January 8, 2007 07:48 PM

Hi Ray,
You can make use of VisibleColumns property of the GridTableDescriptor to show/hide the columns in the grid.

Please refer the following KB article for more details.
How do I hide/unhide the columns in a GridGroupingControl?

Best Regards,
Babu

Ray
Replied On January 9, 2007 10:28 AM

I tried using:
_Grid.TableDescriptor.VisibleColumns.Add(colname);
and
_Grid.TableDescriptor.VisibleColumns.Remove(colname);

No luck

I could not download your sample hidingcolumns.zip.

Here is my sample.

Thanks

Raymond.


>Hi Ray,
You can make use of VisibleColumns property of the GridTableDescriptor to show/hide the columns in the grid.

Please refer the following KB article for more details.
How do I hide/unhide the columns in a GridGroupingControl?

Best Regards,
Babu

WindowsApplication167.zip

Administrator [Syncfusion]
Replied On January 9, 2007 01:02 PM

I tried your sample in 4.4.0.54, and hiding and then unhiding seemed to work OK. Now, the column did not go back where it was. Instead, it was added as the last column in the grid. If you want it to be the first column, then try code like:

_Grid.TableDescriptor.VisibleColumns.Insert(0, "a");

to insert it at column 0 instead of adding it to theend of the collection.

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.

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.

;