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.
Based on the details provided, I understand webDatePicker, Button and WebHierarchicalDataGrid are not in the same update panel. If that is the case due to partial(Ajax) post back WebHierarchicalDataGrid will not be refreshed.
If they are in the same update panel, I would recommend you to set EnableAjax property of WebHierarchicalDataGrid to "false". EnableAjax” property is used to control if the gird will use its own Ajax functionality (the grid is built upon our Ajax Framework - Aikido) and will generate Async Post backs to the Server or will make full Post backs to the Server – when property is set to “false”. This option is useful when “UpdatePanel” is used and the grid is in its content template.
You will find more details on the below links:
<http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.WebDataGrid~EnableAjax.html>
<http://blogs.infragistics.com/forums/t/64272.aspx>
I hope this helps.
Hi,
The Date Picker and Button are outside of the Update Panel. Only the WHDG is inside the update panel. On clicking the button, a AsynPostBack is fired from the UpdatePanel and the code from the earlier post is run. I tried the EnableAjax = False and it didn't change anything. Still only shows the same 1 day of information unless i pick a date where there is no data. Then the grid will be cleared out and then when i select another day with data then it populates it with that days data. Its like it isn't getting the message to clear out the old data before populating the new data and is just keeping the old data.
Additionally, i removed the update panel and just left he date picker, button and WHDG in the page and got the exact same result. So its not the UpdatePanel that is the problem. Something isn't telling the WHDG to rebind the new data even though it was instructed to.
In this case, you may need to call whdg1.GridView.ClearDataSource() before applying the data source.
regards,David Young
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?
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 am just following up to see if you need any assistance with this matter.
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.