Hi,
I am successfully able to display a nested grid. However there is a new requirement and I need some help.
For simplicity, please consider the following.
Outer grid displays grade information with columns like Grade, Instructor, Room
Inner grid display student information with columns like Name, Race.
So far so good.
Now based a condition in outer grid i.e. if Grade is 12, I would like to add a column to the inner grid called SATAppeared. That is, I would like a grid like the following
Grade Instructor Room
3 Kelly 20
Name Race
Bo W
Li A
Grade Instructor Room
12 Mac 34
Name Race SATAppeared
Sue W Yes
Ken W No
To achieve this, in the template of inner grid, I have put a condition on SATAppeared column. Something like the following but it doesnt seem to work. SATAppeared column doesnt display for any of the grades.
.Columns(columns =>
{
columns.Bound(o => o.Name);
columns.Bound(o => o.Race);
if (Model.Grade == "12")
{
columns.Bound(o => o.SATAppeared);
}
}
Can you please help. Thank you!