Using the regular telerik asp.net grid, I had a RadWindow that contains detail items of a record. (opens when clicking an item in a grid).
On the RadWindow, there is a button "Close this window". When hitting this button, the grid on the parent page automatically reloads its records. (this was done using: CloseAndRebind() and refreshGrid (javascript) as described in the Help files.
My question is how to do this with the Prometheus grid ?
Thanks,
11 Answers, 1 is accepted
You can use fireCommand() client-side method to achieve this. Here is an example:
http://www.telerik.com/help/radcontrols/prometheus/grid_fireCommand.html
function refreshGrid()
{
$find("<%= RadGrid1.MasterTableView.ClientID %>").fireCommand("RebindGrid","");
}
All the best,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Another question:
is there some way to encapsulate or call the fireCommand method in an Ajax request ? (because calling the fireCommand command causes a postback of my page)
If you ajaxify the grid using RadAjaxManager or panel all grid methods will be affected as well. Here is an example:
<telerik:RadAjaxManager ID="RadAjaxManager1"
runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have the same set-up, but I am using the Prometheus "Futures" built.
However, the function below results in the error: "Object doesn't support this property or method"
function refreshGrid()
{
var masterTable = $find("<%= gridItems.ClientID %>").get_masterTableView();
masterTable.fireCommand(
"RebindGrid","");
}
The function refreshGrid is inside a telerik radcodeblock.
What am I doing wrong?
Regards
Roel
Please excuse us if our previous reply confused you as it seems we made a mistake here. Actually such argument for the fireCommand client method is not supported and we plan to implement rebind client method which to invoke implicitly the server-side Rebind() method of RadGrid. This will most probably be included in the next version of RadGrid Prometheus.
In the meantime you may consider ajaxifying the grid through RadAjaxManager, trigger ajax request using the AjaxRequest(eventArgs) method of the manager and rebind the grid on the server inside the AjaxRequest handler.
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have tried Ajaxifying, but that didn't work.
I have defined the RadAjaxManager as:
<telerik:RadAjaxManager
ID="RadAjaxManager1"
runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cboUsers">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="gridItems" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="gridItems">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="gridItems" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
The client script to trigger the ajax request:
function refreshGrid()
{
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.AjaxRequest();
}
And the server side event handler:
Protected Sub RadAjaxManager1_AjaxRequest( _
ByVal sender As Object, _
ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) _
Handles RadAjaxManager1.AjaxRequest
Me.gridItems.Rebind()
End Sub
Debugging: the code hits the refreshGrid function and subsequent the AjaxRequest event handler. I can see the data is being reloaded, but when the page is finished the grid is not updated. There are no script errors reported. After a manual refresh of the page the correct data is displayed. The page is inside a masterpage
Any clues?
Can you please confirm that you are using the latest hotfix of RadControls Prometheus (Q3 2007 SP1) released yesterday? If the issue is not solved, I suggest you prepare a small working version of your project and send it enclosed to a formal support ticket. We will debug it locally and will get around to you with more info on the subject.
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thanks,
Jeff
I have installed the 2007 3 1314 hotfix, but without effect.
I will create a small sample application and create a support ticket.
Roiel
We will be expecting your example, feel free to post it in a support ticket once you are ready with it.
Kind regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The solution for my issue was simple: there was only one AjaxSetting missing, see the part in bold.
feedback from Telerik:
When you use the client-side AjaxRequest() method, initiator would be the respective Ajax control you use. So according to these, you need to add the following ajax setting in your AjaxManager:
see also http://www.telerik.com/help/aspnet/ajax/?ajxClientSideAPI.html
<telerik:RadAjaxManager
ID="RadAjaxManager1"
runat="server"
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="gridItems" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="cboUsers">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="gridItems" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>