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.
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.
This happens when the page is loaded.
Could you please send me the sample that you showcased 4 days ago? I've tried the online configuration from our website, although I didn't reproduce the behavior described so far.
Private case with number CAS-201888-T8C7N6 has been created for your convenience, where you can send files privately. In addition to the working sample, it would be very helpful to send me your database as well, below you will find a detailed explanation how to retrieve data plus schema from database, providing both the project and data would be highly appreciated and will help me to investigate the issue in a timely manner.
Steps to retrieve schema + data from a database:
1. Right click on the DataBase (testDb for example).2. Select "Tasks".3. Select "Generate Script".4. Click "Next" press radio button "Select specific database object"5. And Select all tables used in the App6. Click the Next button and select the "Advanced" button.7. From there find "Types of data to script" and change the value not to be "Schema only" but "Schema and data".8. Press "Ok" -> "Next" and "Finish".