I have a grid attached to a table:
[Heading] [Section] [LineCt 2012-11] [RevCt 2012-11] .......
What I would like to do is based on what the user chooses, Line Count or Rev Count, hide either the [LineCt 2012-11] or [RevCt 2012-11] columns.
Noting that I do not know how many of them Line/rev columns I have. Only that I will have 1 each for each Yr/Mnth combo.
Something Like: .DisplayLayout.Bands(0).Columns("Rev%").Hidden = True
Would hide all the Rev count columns.
Hope that makes sense.
Thanks
Deasun
Hi Deasun,
There's no way to index columns with a wildcard like that. What you would have to do is loop through the columns and compare each column's key with the string you want. Something like this:
For Each column As UltraGridColumn In Me.UltraGrid1.DisplayLayout.Bands(0).Columns If (column.Key.StartsWith("Rev")) Then column.Hidden = True Else column.Hidden = False End If Next
Thanks for the reply.
That's what I thought I would have to do.
Just wanted to see if there was wildcard way.