We have a radgrid which when adding or editing records, opens a separate form in a radwindow with it's own .aspx page. We have run into an issue when attempting to add a new, or edit a record from a radwindow and upon clicking the save button in the window, we cannot get the corresponding radgrid to refresh the data properly. The data saves properly in the database, the window closes, the ajax request method server side runs, and rebind method server side for the grid also runs when called from the ajax request method.
This used to work on the older RadControls back before we upgraded the site to the ASP.NET AJAX RadControls. The following sets of code are how we open the radwindow, save the data and close the radwindow, call the ajaxrequest method, and call the grid rebind method.
We open the radwindow dynamically through the itemcommand event of the radgrid as such:
This is the save button method from the window, which saves the new or existing record, and closes the window:
This is our javascript method, located in an external .js file which closes the radwindow:
After the save button event runs from the aspx page in the radwindow, it accessed the refreshGrid() javascript method on the aspx page which contains the radgrid. This is our code to get the id of the radajaxmanager to begin the Ajax Request:
The Ajax Manager we have on the same .aspx page as the radgrid has the following settings applied:
The following code is the Ajax Request run server side:
Then the rebind hits our NeedsDataSource Method and in theory should rebind the grid and refresh the data. However, after we run this process the grid does not refresh the data, unless we hit the refresh command link in the command header we created on the grid.
We have confirmed through testing that our Ajax Request event is being accessed and running the grid rebind method in the server side code. We are not receiving any javascript errors either.
On the older RadControls we had to force the postback on the page to get the AjaxManager to properly reload the grid data, which we found through the forums:
Has anyone run into this issue before with the ASP.NET AJAX controls? If so, how were you able to get the grid to refresh the data? Is it possible that the way we are opening the radwindow could cause the grid not to refresh?
We appreciate any help or suggestions.