I am using a GridView which has filtering enabled. The GridView control itself is bounded to data via the following command:
This correctly populates the GridView with rows. If I click on the funnel icon in the column headers, I get presented with a checkbox treeview structure, listing all the distinct values. From here, I am able to check/uncheck values to set the filter accordingly. This is good.
However, if I drill down on these rows such that a child template is loaded via "load on demand" / "lazy loading", when clicking on the funnel icon in the child GridView, the checkbox treeview structure only contains the "All" item, and no other values. I would like to see a list of checkboxes with all the distinct values, in the same way as the parent template.
Please see screenshots.
Note that the child template is populated via the RowSourceNeeded eventhandler, and creates rows by iterating over a result set (i.e. the DataSource property is not set for the child template):
I'd appreciate your help on this.
Thanks in advance.
radGridView1.DataSource = db.AppUsage(1,
new
DateTime(2011, 2, 10),
new
DateTime(2011, 5, 11));
This correctly populates the GridView with rows. If I click on the funnel icon in the column headers, I get presented with a checkbox treeview structure, listing all the distinct values. From here, I am able to check/uncheck values to set the filter accordingly. This is good.
However, if I drill down on these rows such that a child template is loaded via "load on demand" / "lazy loading", when clicking on the funnel icon in the child GridView, the checkbox treeview structure only contains the "All" item, and no other values. I would like to see a list of checkboxes with all the distinct values, in the same way as the parent template.
Please see screenshots.
Note that the child template is populated via the RowSourceNeeded eventhandler, and creates rows by iterating over a result set (i.e. the DataSource property is not set for the child template):
void
radGridView1_RowSourceNeeded(
object
sender, GridViewRowSourceNeededEventArgs e)
{
GridViewRowInfo rowInfo = e.ParentRow;
String packageId = rowInfo.Cells[
"PackageId"
].Value.ToString();
String parentPackageId = rowInfo.Cells[
"ParentPackageId"
].Value.ToString();
WorkspaceMiQEntities db =
new
WorkspaceMiQEntities();
foreach
(var u
in
db.Usage(1,
new
DateTime(2011, 2, 10),
new
DateTime(2011, 5, 11),
null
, Int32.Parse(packageId),
null
, Int32.Parse(parentPackageId)))
{
GridViewRowInfo row = e.Template.Rows.NewRow();
row.Cells[
"StartDateTime"
].Value = u.StartDateTime;
row.Cells[
"EndDateTime"
].Value = u.EndDateTime;
row.Cells[
"UserName"
].Value = u.UserName;
row.Cells[
"DomainName"
].Value = u.DomainName;
row.Cells[
"DeviceName"
].Value = u.DeviceName;
e.SourceCollection.Add(row);
}
db.Dispose();
}
Thanks in advance.