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

Gridgroupingcontrol and hidecols

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();
}

3 Replies

BC Babu Chella Velu Syncfusion Team January 9, 2007 12:48 AM UTC

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


RA Ray January 9, 2007 03:28 PM UTC

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


AD Administrator Syncfusion Team January 9, 2007 06:02 PM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon