Sorry for a bit newbie quetion - my "first" steps with ASP :)
There are two objectdatasources assigned to WebHierarchicalDataSource.Objectdatasource calls some function to get first and second level of data - lets say GetCustomers for level1 and GetOrders for level2.
I get first level data based on some hidden Id, after that - how can I parametrize objectdatasource to get orders only for customer being loaded or customer being expanded ?
The WebHierarchicalDataGrid control has a load on demand feature; the control only retrieves data when needed, such as when a row is expanded. The InitialDataBindDepth property controls this feature. The property is set to 0 by default, initially only loading the root data. Any numeric value thereafter determines the successive data level(s) to load at start up. A value of -1 disables load on demand and loads all data levels.
The EnableAjax property affects the manner in which data is received when using load on demand. The property is True by default and allows data retrieval to be asynchronous. If this property is False, data retrieval results in a full page postback.
Following link will give you more details regarding this featur
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebHierarchicalDataGrid_Load_On_Demand.html
Please let me know if you have any further questions regarding this matter.
Ok, InitialDataBindDepth comes in handy, but
my question was concerning grid interaction with hierarchical object datasources.
For example - first we load all customers into root band (band0). Then we load orders into child band (band1). Each order is joined with customer by customer_id.
In ideal world there should be one call to GetAllCustomers and one to GetAllOrders, then both collections are organized by WebHierarchicalDataSource.Instead there are multiple calls for child band collection, as an effect application is retrieving all orders many times, which is not too effective.
Seems like there is call to GetAllOrders issued for each customer. I would like to know how could I instruct grid to pass customer_id into objectdatasource when calling getorders.
Hello Arthur,
Please let me know if I can provide any further assistance regarding this matter.
Hello Artur,
You can manually control the load on demand process using Manual load on demand. The control’s RowIslandsPopulating event is raised every time a row is expanded; at this point, data is requested for the row’s child row island(s). You can use this event to manually create a container grid that represents the row island(s) and then bind it to the data that you retrieved.
Following links will give you more details on this feature.
http://ko.infragistics.com/products/aspnet/sample/hierarchical-data-grid/manual-load-on-demand