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

Hiding a group of columns and then showing then in the original position and order in a ggc via VisibleColumns.Add



I have the fllw columns (description, rate, 1Q2006, 2Q2006, 3Q2006, 4Q2005, Aggregate.) in a ggc in the exact order. This is the default order of the columns in the VisibleColumns collection.



I have a drop down with the fllw values (All Quarters, 1Q2006, 2Q2006, 3Q2006, and 4Q2005)

When the user select a specific quarter, I want to hide all the other columns and show only the selected quarter.

The way I go about this is to hide all the Quarters columns (via VisibleColumns.Remove) and then add the selected Quarter back via (VisibleColumns.Add)

The problem is that when I add the the selected Quarter back, it's add after the 'Aggregate' columnn. I did not see a VisibleColumns.AddAt method. Is there a way I can easily accomplish this?

1 Reply

JB James Blibo December 4, 2006 05:00 AM UTC

never mind.. found it... example...
ordersDescriptor.VisibleColumns.Insert(3, new GridVisibleColumnDescriptor("Freight"));

Loader.
Live Chat Icon For mobile
Up arrow icon