protected void UltraWebGrid1_DemandLoad(object sender, RowEventArgs e)
{
UltraGridBand band = UltraWebGrid1.Bands[e.Row.Band.Index + 1];
if (band.Columns.Count == 0)
{
band.Columns.Add(new UltraGridColumn());
band.Columns.Add(new UltraGridColumn());
band.Columns[0].HeaderText = "ID";
band.Columns[1].HeaderText = "Number";
}
string rowLevel = "";
UltraGridRow row = e.Row;
while (row != null)
{
rowLevel += "_" + row.Index;
row = row.ParentRow;
}
for (int i = 0; i < 5; i++)
{
e.Row.Rows.Add(new UltraGridRow());
e.Row.Rows[i].Cells[0].Value = UltraWebGrid1.ID + "r" + rowLevel + "_" + i.ToString();
e.Row.Rows[i].Cells[1].Value = i;
e.Row.Rows[i].ShowExpand = true;
}
if (UltraWebGrid1.Bands[band.Index + 1] == null)
UltraWebGrid1.Bands.Add(new UltraGridBand());
}