Hi,
I am new to Telerik RadControls, hence kindly excuse any mistakes. What I am trying to achieve is:
1) A web page with RadComboBox and a hyper link.
2) User clicks on Hyper Link to Open a Rad Window. User enters a value and saves value to database.
3) RadWindows closes. The RadCombo box on the parent window should be refreshed.
Going thru other posts, I was able to achieve all three and the RadCombo is also bound when the Radwindow closes, but it does not refresh. It still shows the old values ( and not the new value). If you explicitly refresh the page then it will populate RadCombo with new value.
Please advise. This is the code I am using:
Home.aspx where the RadCombo control is:
Home.aspx - Javascript to make an ajaxrequest on radwindow close:
Home.aspx - RadCombo and a Hyperlink:
Home.aspx - to open the radwindow
Home.aspx - code behind:
Home.aspx - Ajax request. Load Category List actually makes a database call and binds to RadCombo
TIA!
I am new to Telerik RadControls, hence kindly excuse any mistakes. What I am trying to achieve is:
1) A web page with RadComboBox and a hyper link.
2) User clicks on Hyper Link to Open a Rad Window. User enters a value and saves value to database.
3) RadWindows closes. The RadCombo box on the parent window should be refreshed.
Going thru other posts, I was able to achieve all three and the RadCombo is also bound when the Radwindow closes, but it does not refresh. It still shows the old values ( and not the new value). If you explicitly refresh the page then it will populate RadCombo with new value.
Please advise. This is the code I am using:
Home.aspx where the RadCombo control is:
<
telerik:RadAjaxManagerProxy
ID
=
"RadAjaxManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxPanel1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"radddl"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
>
</
telerik:RadAjaxLoadingPanel
>
Home.aspx - Javascript to make an ajaxrequest on radwindow close:
function
closeRadWindow()
{
//debugger WORKS!
$find(
"<%= RadAjaxManager.GetCurrent(Page).ClientID %>"
).ajaxRequest(
"content"
);
}
Home.aspx - RadCombo and a Hyperlink:
<
td
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
Height
=
"50px"
Width
=
"50px"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
telerik:RadComboBox
ID
=
"radddl"
runat
=
"server"
>
</
telerik:RadComboBox
>
</
telerik:RadAjaxPanel
>
</
td
>
<
td
>
<
a
href
=
"#"
id
=
"link1"
>
Add Category
</
a
>
</
td
>
Home.aspx - to open the radwindow
<
telerik:RadWindowManager
ID
=
"RadWindowManager2"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"AddCategoryWindow"
runat
=
"server"
OnClientClose
=
"closeRadWindow"
Behaviors
=
"Close"
NavigateUrl
=
"~/template/AddTemplateCategory.aspx"
OpenerElementID
=
"link1"
modal
=
"true"
Height
=
"200px"
Width
=
"200px"
ShowContentDuringLoad
=
"false"
Title
=
"Add Category"
VisibleStatusbar
=
"false"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
Home.aspx - code behind:
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
this
.LoadCategoryList();
}
RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);
ajaxManager.AjaxRequest +=
new
RadAjaxControl.AjaxRequestDelegate(ajaxManager_AjaxRequest);
}
Home.aspx - Ajax request. Load Category List actually makes a database call and binds to RadCombo
protected
void
ajaxManager_AjaxRequest(
object
sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
this
.LoadCategoryList();
}
TIA!