Is there any way to access the display objects of an UltraGrid
I would like to acces the number of columns, headings objects and other object of an UltraGrid after it is displayed? We have many different grid and would like build a common method to export data from the UltraGrids.
Hi,
I'm not really sure I understand your question. What exactly do you mean by "display objects"?
You can certainly access the grid columns, headers, rows, etc. at run-time though the grid's object model.
uGrid.DataSource = ds;
Different columns and bands are hidden for different modes (monthly, quarterly, annual, variance....) There may be 4,12, or n columns displayed. How do I get things like the number of columns, the heading for each column, the number of rows that are displayed?
ie Heading1 = uGrid.Columns[0].Heading or numColumns = uFrid.Columns.Count ?
Oh, okay, so you want the visible columns. There are a couple of ways to do that. One way would be to use the grid.ActiveColScrollRegion.VisibleHeaders collection. Another would be to use the GetFirstVisibleCol method on the band and then use GetRelatedVisibleColumn on the column to loop through the visible columns.
For rows, it depends on why the rows are invisible. You can probably use grid.Rows.GetFilteredInNonGroupByRows or GetRowsEnumerator.