I use version 17.2.
I have a misunderstanding about the use of the webhierarchicaldatasource of the webhierarchicaldatagrid.I use it with 2 SqlDataSource with parameters. (parent and child).
I have the property InitialDataBindDepth="-1", so i'm loading all data in one time.
I don't understand why i have N select on the detail select. I should have ONE select for the parent and ONE for the child, right ?
For example, if I have 5 affected rows after SDSFactureEnt_Selecting (parent), the SDSFactureDet_Selecting method(child) is repeating 5 times. Is that normal ?
it penalizes the performance of the web page.
You can interpret the parent:child relation as you like, for example 1:n, which mean that child should hold the foreign key which indicates where it belongs to (parent primary key). If you have duplicate keys,then such repeating may happen.
The WHDG data source, doesn't case for the provided data as long it is valid.
My suggestion is to have a look at our online sample and the two topics below:
Add single parent to single child relation
Add parent to multiple child relation
thank you for your feedback, but I already looked at your online sample
I have the same configuration. The only difference is that i use a SqlDatasource with select parameters.
I am sure that if you test your example with a break point in a child selecting method, you will have many repeating select.
For example, if i make a specific select as Supplier ID < 4 in your online sample
Can you check that you have only one select on AccessDataSource2 ? I'm not sure about that. In my case, I have 4 selects.
I hope it's clear, English is not my native language.
Correct me if I am wrong, as I understand you have a complex select query specified with the "SelectCommand" attribute, which is okay, after all it is important the returned data to be bound correctly to the Grid. You can Join different tables and combine different fields in order to return the desired result from your data base, so my questions is do you experience any problems with that and how can I help you?
I just want to have one access to the database for my child selection request.Currently the process makes as many accesses to the database as there are selected parents.If I have 4 parents selected, I will have 4 times the same SQL query that will run. It's not OK, imagine if you have many thousands record in the WHDG...
How can I get ONLY one access to the database for my parent SQL query and ONLY one access for my child SQL query?
What version of infragistics controls are you using.
We has similar issue. Before Web.RELEASE_17.2.20172.2123. In versions after the 2123 the issue appears only when you have BoundCheckBoxField or UnboundCheckBoxField. The bug with BoundCheckBoxField and UnboundCheckBoxField is resolved in the latest 18.1, 18.2 and 19.1 releases.
Can you try to upgrade the 17.2 with version greater than 2123 and to remove the Checkboxes to see if this same issue.
I have upgraded to Version=19.1.20191.115 and I have the same issue.
Here is the test code used in the simplest way. There is no BoundCheckBoxField or UnboundCheckBoxField.
Here is the result with breakpoints when I load the page
Thanks for your help.
You can set the EnableDataViewState property to true, and it will decrease the database calls.
Here is more information about the property: https://www.infragistics.com/help/aspnet/webdatagrid-getting-started-with-webdatagrid-enabledataviewstate-property
Sorry, it doesn't fix the issue.
I have the same behavior like the gif animated above.
Another idea ?
Is this happens first time when you load the grid or when you do a post back (for example form button click).
Also you do not need to call DataBind of the grid, this will be done form the source and is not needed. When the grid is loaded it is dabound from the code and calls the select commands from the data sources when you call DataBind form your code it calls the select commands again.