i have to specify total number of nested GridTableView and create a detail table to each GridTableView created
depends on the input #of time nested
example input 5 nested GridTableView
output should be like this:
GridTableView 0
GridTableView1
GridTableView2
GridTableView 3
GridTableView 4
| public GridTableView CreateDetailTable(int i) |
| { |
| GridTableView table = new GridTableView(); |
| table.Name=string.Format("GridTableView{0}", i); |
| return table; |
| } |
| public GridTableView AddDetailTable(GridTableView view,int i) |
| { |
| view.DetailTables.Add(CreateDetailTable(i)); |
| foreach (GridTableView vw in view.DetailTables) |
| { |
| tableview = vw; |
| } |
| return tableview; |
| } |
| private void GenerateDetailTable(int count) |
| { |
| gtv = new GridTableView(); |
| GridTableView tempView = CreateDetailTable(0); |
| gtv.DetailTables.Add(tempView); |
| GridTableView Loop = gtv; |
| for (int i = 1; i < count; i++) |
| { |
| tempView=AddDetailTable(tempView, i); |
| foreach (GridTableView item in Loop.DetailTables) |
| { |
| item.DetailTables.Add(tempView); |
| Loop = item; |
| } |
| } |
| } |
example input 3 nested GridTableView
output should be like this:
GridTableView0
GridTableView1
GridTableView2