Hello,
I'm having trouble with disappearing expander icons in my WHDG. I've attached a working sample based on other examples I've compiled from reading the forums. I have a multi-level hierarchy, each level is created by taking the key from the parent and using it to create a new dataset for the child. The expanders appear fine on the parent and on the expanded child. However, if I expand another child (without collapsing the previously expanded child) the expander icons vanish on the previously expanded row preventing the user from drilling down any further.
Maybe related, when I enable Ajax, I get a "Async request failed. Failed to load viewstate..." error. I think the problem I'm facing has something to do with postback but I can't figure it out.
I've attached a working sample as well as some screenshots of the problem.
Any help would be most appreciated. Thanks!
Hello Cody ,
Thank you for posting in our forum.
I’ve looked into your sample and it seems that this is due to the EnableDataViewState being set to true. The grid will attempt to load the data for the already initialized row island from the view state. It will only initialize the rows from the newly expanded row island so the manual setting you apply in the InitialzeRow event to make the rows expandable will be executed only for the new row island’s rows.
Since you’re providing the data source on each postback and you’re manually loading on demand for the child row islands ,setting EnableDataViewState to true should not be necessary.
Setting it to false will reinitialize all rows so the logic for setting IsEmptyParent will work as expected.
Regarding the view state error . It seems to be due to the fact that you add a new band to the grid on each postback during Page Load: WebHierarchicalDataGrid1.Bands.Add(YearBand).
It suffices to do this just once. So if you add the following check:
If WebHierarchicalDataGrid1.Bands.Count = 0 Then
WebHierarchicalDataGrid1.Bands.Add(YearBand)
End If
Then the ajax of the grid will work as expected.
Let me know if you have any questions or concerns on the matter.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
I am having same problem could you please let me know where i have to add above code??
Maya,
Thank you for the quick response. I adjusted my code to both disable the Data ViewState and to Prevent Band Duplication during Page Load with the look-ahead you described. My 3-tier grid is now working as expected, with no missing expanders. The AJAX mode is now also working properly.
Thanks again!
-Cody