This is a migrated thread and some comments may be shown as answers.

GridView Filter Has No Checkboxes After Lazy Loading

1 Answer 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrew Jackson
Top achievements
Rank 1
Andrew Jackson asked on 11 May 2011, 05:30 PM
I am using a GridView which has filtering enabled. The GridView control itself is bounded to data via the following command:

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();
     
}
I'd appreciate your help on this.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 17 May 2011, 09:03 AM
Hello Andrew Jackson,

Thank you for writing.

Currently the Excel-like filtering functionally is not supported in load on demand scenarios. We will consider improving this feature in our future releases. To work around the issue, you can use the filtering row for child views.

Let me know if you have any other questions.

All the best,
Martin Vasilev
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Andrew Jackson
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or