This is what I'm currently doing to get the visible column count:
Dim colTemp As UltraGridColumn = gridTemp.DisplayLayout.Bands(0).Columns(0) colTemp = colTemp.GetRelatedVisibleColumn(VisibleRelation.First) Dim nColCount = 0 Do While colTemp IsNot Nothing colTemp = colTemp.GetRelatedVisibleColumn(VisibleRelation.Next) nColCount += 1 Loop
Is there no easier way, like gridTemp.Columns.Count?
Thanks,
This will give you the total column count on the root band.
gridTemp.DisplayLayout.Bands[0].Columns.Count
If you only want the count of visible columns, you could do this:
this.ultraGrid1.ActiveColScrollRegion.VisibleHeaders.Count;
But the latter assumes that you are not using Groups, that your RowLayoutStyle is set to None, and that you are not using more than one ColScrollRegion with Exclusive columns.
Ah, you are awesome. Thank you!
The second option wasn't what I was looking for, even though I said visible, but the first one was, and I learned something new with the way the second one works... literally what columns are visible.
Thanks again! :)
Hi Keith,
Thank you for contacting Infragistics Developer Support.
I am glad that you have resolved your issue. Let me know if you have any additional questions.