Hello,
I have 1 datepicker, a button and a WHDG on a page. the WHDG is behind a Update Panel. When i do a search, the grid displays the data as expected. When i go to another date, the grid doesn't refresh. I have debugged the function and i can see that the correct data is coming back from the server into th WHDG datasource but for some reason it isn't rebinding the data when instructed.
The function looks like this:
public void search(Object sender, EventArgs e){
using (XMLDataSource xmlDataSource = new XMLDataSource()) { xmldataSource.XPath = @"/List/User"; xmldataSource.EnabledCaching = false; xmldataSource.Data = GetCases(WebDateStart.Text); whdg1.DataSource = xmlDataSource; whdg1.DataBind(); }}
what i'm expecting is to use this as a report where the users can drill down to a certain level and then change dates and redisplay the current structure with new data in the child records.
Hi Bhadresh,
I have a similar problem. I removed updatePanel, EnableAjaxViewstate=false, RefreshBehaviors() and whd.gridview.ClearDataSource(). None of them seems to work.
The odd problem is the Bands(Child) values and child column header are getting refreshed after post back. but the parent grid rows and columns are not getting refreshed. But when I debugged the code it seems to working correctly. But the parent grid is not refreshing.
I am just following up to see if you need any assistance with this matter.
Refer to the document on the below link that will give you more details ClearDataSource method of ContainerGrid Class:
<http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.ContainerGrid_members.html>
RefreshBehaviors() method will Recreate the GridView and re-databinds WebHierarchicalDataGrid so the behaviors of the ContainerGrids and the GridView will be refreshed to reflect changes made to the Bands behaviors while ClearDataSource method will clear the grid's DataSource and DataSourceID properties, as well all objects that are depending on the DataSource. This function should be called, right before a new data source is assigned to the grid
<http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.WebHierarchicalDataGrid~RefreshBehaviors.html>
<http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.WebDataGrid~ClearDataSource.html>
I hope this helps.
Ah.. Thank you!
Additional questions.
1. Where in the 11.2 documentation is the detail on "GridView.ClearDataSource()" located? 2. While I was looking through the properties of the whdg and found WebHierarchicalDataGrid1.RefreshBehaviors() which appeared to do the same thing as the ClearDataSource(). What is the difference between them?
Hi,
In this case, you may need to call whdg1.GridView.ClearDataSource() before applying the data source.
regards,David Young