Hi all, i have successfully created a grid in code with columns and rows, however i am unable to create the hierarchy in code.
we uses old school multidimensional arrays here(not my choice), so i am unable to use the traditional dataset or collection.
Essessional i loop through in page_load and create all my columns on grid, then i loop through each row and create individual cells, that all works as long as i dont call .DataBind() on the grid, however i am unable to actually create that child band and dynmically bind that data so the hierarchy works, please help or tell me if i am wasting my time.
code below:
UltraWebGrid grid = setupGrid();
// Add columns to grid.
foreach (Column columnn in columns) {
grid.Columns.Add(columnn.DisplayName, columnn.DisplayName);
}
// Add rows to grid.
for (int i = 0; i < data.Length; i++) {
UltraGridRow row = new UltraGridRow();
for(int j = 0; j < data[i].Length; j++)
{
Column column = dd.getColumnAt(j);
if (column.Type == mincom.abstraction.ColumnType.CTDATASET) { //We have nested data, do somethiong here.
} else {
row.Cells.Add(new UltraGridCell(data[i][j]));
grid.Rows.Add(row);
Thanks
Rob
IIRC, when you add columns and rows to a grid, without specifying which band, everything goes to band(0).
You may need to use "grid.bands(N).columns" in places where you've used "grid.columns".
HTH