Hy
I do have the following scenario: I am having a Radgrid inside a visual Webpart which is using AJAX. The Radgrid with the Loadingpanel exists within the UserAdministrationUserControl, the RadAjaxmanager is added to the UserAdministrationWebpart.cs by following code:
So far it works quite well. However I have the scenario, the Edit-Button of the Radgrid opens a ModalDialogPopup for editing the selected User. When editing is finished and the ModalDialog is closed, the Radgrid should be reloaded/refreshed. This is possible by a javascript function, which is called after closing the modaldialog by a callback. And here is my problem.
The Callback-function should do just the following:
But of course that isn´t possible as the RadAjaxmanager doesn´t exist in the UserControl, where the Javascript and the other controls are.
I´ve tried giving the RadAjaxmanager an Id and finding it by:
But that doesn´t work, the Control cannot be found (in the console it returns the function as "$find('').ajaxRequest("Rebind") ).
While Debugging, I´ve found out, that the AjaxManager always gets the same ClientID, so the following is starting a refresh (i didn´t set the controls ID in that case):
However, I do not want to hardcode the Controls ClientID. Besides, altough it is updating the Radgrid in that case, the LoadingPanel does not show up by using that Javascript (it works without a harm in all other cases eg. paging). And therefore it is not very userfriendly.
Any Help and suggestions will be very appreciated
Regards
I do have the following scenario: I am having a Radgrid inside a visual Webpart which is using AJAX. The Radgrid with the Loadingpanel exists within the UserAdministrationUserControl, the RadAjaxmanager is added to the UserAdministrationWebpart.cs by following code:
protected
override
void
OnInit(EventArgs e)
{
base
.OnInit(e);
ajaxmgr =
new
RadAjaxManager();
ajaxmgr.AjaxRequest +=
new
RadAjaxControl.AjaxRequestDelegate(AjaxManager_AjaxRequest);
Page.Items.Add(
typeof
(RadAjaxManager), ajaxmgr);
Page.Form.Controls.AddAt(0, ajaxmgr);
}
protected
override
void
CreateChildControls()
{
Control control = Page.LoadControl(_ascxPath);
Controls.Add(control);
RadGrid panel = control.FindControl(
"RadGrid1"
)
as
RadGrid;
RadAjaxLoadingPanel loadingPanel = control.FindControl(
"RadAjaxLoadingPanel1"
)
as
RadAjaxLoadingPanel;
ajaxmgr.AjaxSettings.AddAjaxSetting(panel, panel, loadingPanel);
}
So far it works quite well. However I have the scenario, the Edit-Button of the Radgrid opens a ModalDialogPopup for editing the selected User. When editing is finished and the ModalDialog is closed, the Radgrid should be reloaded/refreshed. This is possible by a javascript function, which is called after closing the modaldialog by a callback. And here is my problem.
The Callback-function should do just the following:
$find(
"<%= RadAjaxManager1.ClientID %>"
).ajaxRequest(
"Rebind"
);
But of course that isn´t possible as the RadAjaxmanager doesn´t exist in the UserControl, where the Javascript and the other controls are.
I´ve tried giving the RadAjaxmanager an Id and finding it by:
$find(
'<%# this.Page.Forms.FindControl("MyRadAjaxManager").ClientID %>'
).ajaxRequest(
"Rebind"
);
But that doesn´t work, the Control cannot be found (in the console it returns the function as "$find('').ajaxRequest("Rebind") ).
While Debugging, I´ve found out, that the AjaxManager always gets the same ClientID, so the following is starting a refresh (i didn´t set the controls ID in that case):
$find(
"ctl00_ctl44"
).ajaxRequest(
"Rebind"
);
However, I do not want to hardcode the Controls ClientID. Besides, altough it is updating the Radgrid in that case, the LoadingPanel does not show up by using that Javascript (it works without a harm in all other cases eg. paging). And therefore it is not very userfriendly.
Any Help and suggestions will be very appreciated
Regards