Hi,
I encounter the following strange behaviour when using the Telerik RadGrid.
I have a 3-tiered hierarchical RadGrid. Simplified:
<RadGrid>
<NestedViewTemplate>
<RadGrid>
<NestedViewTemplate>
<RadGrid>
</RadGrid>
</NestedViewTemplate>
</RadGrid>
</NestedViewTemplate>
<RadGrid>
The HierarchyLoadMode is set to "ServerOnDemand" (default?), and all data is wired using the NeedDataSource event. The EditForm is set to a WebUserControl.
This construction however poses two significant problems:
- When a parent grid item is expanding, the parent's NeedDataSource event is called, while it isn't specifically needed for the parent to rebind. In fact, if I check the GridRebindReason property and make it so it doesn't set the DataSource property when the reason is GridRebindReason.DetailTableBinding, it works perfectly. So if the parent isnt required to rebind, why does it call the eventhandler? It reduces the amount of database querying by a lot if I filter for the DetailTableBinding flag.
- Even more "disturbing": When I try to edit or add any item, in the parent grid or either of the childgrids, the NeedDataSource event is called for every RadGrid in the hierarchy. Which results in a lot of queries for radgrids that aren't even visible on the page.
Is this a known problem? And more importantly, is there any way around this? I'd attach the code but sadly I don't have a clean version of the page.
Above problems are encountered using ASP.NET 3.5, C#, and the ASP.NET AJAX toolkit Q1 2010
Greetings