Here is what I am trying to achieve:
I have two radio buttons on the page :Examples and Details. On page load I have a whdg which loads on demand data and gives all the rows correctly. I can expand to get the child rows. the problem comes when I have child grid behaviours turned on. If i try to say page/sort on a child grid and WITHOUT collapsing when I click the 'Details ' radio button, it will show me the new data in the grid. But the actual problem comes when I try to click the 'examples' radio button again where it says table 'tabl1' does not contain a row with the name Id.
Also how can i make sure that the child grid is autocollapsed when i click any other radio button?
the error is:
Table mytable doesn't contain a row with the specified PrimaryKey value
Hello dev_here ,
Thank you for posting in our forum.
Are you changing the DataSource for the WHDG when you click on a the radio button? If that’s the case make sure that you first clear the previous data source with:
this.WebHierarchicalDataGrid1.GridView.ClearDataSource();
And then set your new one.
Let me know if this will resolve the issue. Otherwise to further look into the issue I would need a sample that replicates it or a code snippet of how your grid is set up in the mark-up and your data binding logic.
I’m looking forward to your reply.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Right before you set the new data source. For example:
this.WebHierarchicalDataGrid1.DataSource=YourNewDataSource;
this.WebHierarchicalDataGrid1.DataBind();
Let me know if you need further assistance.
well, yes I am kinda changing the datasource because the datset now contains new data. But where is it that I call .ClearDataSource()? before i bind the datasource?