This is a migrated thread and some comments may be shown as answers.

ajaxsetting for radcombobox inside usercontrol

6 Answers 49 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
MBEN
Top achievements
Rank 1
Veteran
MBEN asked on 17 Sep 2012, 09:03 PM
Hi,

On my content page I have a usercontrol and a radgrid.
I have a radcombobox inside the user control. On changing the sleection in the combobox I need to update the grid but it ends with a page flash. How can i add the radcombobox to the ajaxsettings to remove the page flash/postback when updating the grid?

I have tried adding the combo and the grid in ajaxsetting dynamically but that does not help either.

Please suggest.

6 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 20 Sep 2012, 04:00 PM
Hello,

If you have a control in UserControl that should ajaxify a control in the main page, the AjaxSetting should be added in the code behind. Take a look at the following code:
protected void Page_Load(object sender, EventArgs e)
{
    RadAjaxManager1.AjaxSettings.AddAjaxSetting((User control ID).FindControl("RadComboBox ID"), RadGrid1);
}

I also prepared a small sample and attached it to this post.

Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
MBEN
Top achievements
Rank 1
Veteran
answered on 20 Sep 2012, 04:42 PM
Hi,

I tried the code and it does not work in my case.
I forgot to mention that I am using a master-content page so the grid is on the content page. I have a RadAjaxManagerProxy on my content page. Does that make a difference?

I tried the code sample with adding a master page and it stopped working as desired.Could you give me a working sample with a master-content scenario?
0
Kostadin
Telerik team
answered on 25 Sep 2012, 08:33 AM
Hello,

It does not make any difference. RadAjaxManager could handle all the MasterPage and WebUserControls scenarios no matter the complexity of the application. The following code show how you could achive this:
protected void Page_Load(object sender, EventArgs e)
{
    RadAjaxManager mngr = RadAjaxManager.GetCurrent(Page);
    mngr.AjaxSettings.AddAjaxSetting(combo1.FindControl("RadComboBox1"), RadGrid1);
 
}

I modify the sample from my previous post and attached it again. Additionally you could check out this help article for more information.

All the best,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Waseem
Top achievements
Rank 1
answered on 10 Oct 2012, 08:22 PM
How to add Ajaxsetting in javascript as well as how to remove Ajaxsetting in javascript.

In C#, i know how to use it. but in javascript i have no idea.
  RadAjaxManager1.AjaxSettings.Clear();
  RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, drpType);
0
Kostadin
Telerik team
answered on 15 Oct 2012, 03:30 PM
Hi Waseem,

The AjaxSettings collection of RadAjaxManager can be modified only server-side. If you are still unable to achieve your goal using server-side settings, you could prepare a runnable sample that reproduces the problem that you are facing and send it to us in a formal support ticket, so we can help you fix it.

Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Waseem
Top achievements
Rank 1
answered on 15 Oct 2012, 03:45 PM
Thanks Kostadin
I solved it.
ViewState["Testing"]=1;

Basically I open RadWindow (Parent). In RadWindow i have many textbox and many drop down. so i have button at the end of every dropdown. when i click it. it will open another RAdwindow where we can insert value to drop down. so when i insert record.i don't want to refresh parent whole page. i want to refresh only selected drop down. i don't want loose all my input values and as well as other selected drop down values. i only want to refresh selected dropdown.
I handle it on load event. When i click on button at the selected drop down. i add value to viewstate as well as remove all old ajax setting and add ajax setting to  only selected drop down. so when child drop down is closed. only selected drop down is refresh.

Regards
Muhammad Waseem
Tags
Ajax
Asked by
MBEN
Top achievements
Rank 1
Veteran
Answers by
Kostadin
Telerik team
MBEN
Top achievements
Rank 1
Veteran
Waseem
Top achievements
Rank 1
Share this question
or