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??
Abhijeet,
The suggestion that Maya made was to check if the band was already added before adding it in the sample that Cody provided. In this sample he was doing this in the BindGrid method. If you are doing something similar the check would need to be before you dynamically add a band to your grid.
We are not adding bands, we are binding datasource on demand to child bands. And on page load we are attaching view state data to WHDG.
This scenario doesn't seem to match the issue raised in this thread and you should start a new thread with more details that include the following:
This information will help to understand what you are asking.
Hello Alan,
Please see the post created by me.
http://es.infragistics.com/community/forums/t/104554.aspx
Mike P is already looking into that thread and he will continue to assist you.