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

Difficulties with RadAjaxManager

5 Answers 87 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jean
Top achievements
Rank 1
Jean asked on 17 Jun 2010, 10:33 AM
Hi guys !

I am a bit lost with the use of RadAjaxManager, and I don't know how to regulate the error : "Message d'exception : Only one instance of a RadAjaxManager can be added to the page!"

Indeed I developped a page.aspx in which I use a component.ascx

This component contains a tree view with a RadAjaxManager.

But in page.aspx, I am using a RadComboBox, and I would like to do a filter as this example : http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx

That is why I need to add to my page :
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadComboBox2"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadComboBox1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 

But if I do that, as I have already a RadAjaxManager in component.ascx, I have the error : " Message d'exception : Only one instance of a RadAjaxManager can be added to the page!"

So I know why I have this error but I really can't find a solution to make it working...

Can you please help me ?

Thanks


5 Answers, 1 is accepted

Sort by
0
Seth
Top achievements
Rank 1
answered on 17 Jun 2010, 09:23 PM
On your control, try using RadAjaxManagerProxy instead of the RadAjaxManager.
0
Jean
Top achievements
Rank 1
answered on 22 Jun 2010, 02:23 PM
Thanks for this answer.

In fact I am not searching in the good direction I think, because the RadAjaxManager is used to make both combo box working together no ?

I defined the combo box component like  that :
<telerik:RadComboBox ID="docTypeComboBox" runat="server" OnTextChanged="docTypeSelected" AutoPostBack="true"/> 

And in code behind :
docTypeComboBox.EmptyMessage = this.GetLocalResourceObject("docType_emptyListItemResource").ToString(); 
 
                DataTable dt = new DataTable(); 
                dt = buildDocTypeDataTable(dt, list); 
 
                docTypeComboBox.AllowCustomText = true
                docTypeComboBox.DataSource = dt; 
                docTypeComboBox.DataTextField = "Name"
                docTypeComboBox.DataValueField = "Code"
                docTypeComboBox.DataBind(); 

This displays what I expect in the combo box, I can write a text to filter, but it doesn't filter...

Did I forget something ?

Thank you


0
Seth
Top achievements
Rank 1
answered on 22 Jun 2010, 02:30 PM
I think you need to post more information about what you are trying to do.  Also if possible post more code, client side and server side, as well.
0
Jean
Top achievements
Rank 1
answered on 22 Jun 2010, 04:20 PM
Ok thank you Seth Ricard.

I want to do as in this example : http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx
with the combo box on the center, that is to say, when the user is writing some text, it makes a filter...

To do that, I defined the combo box like that :

<telerik:RadComboBox ID="docTypeComboBox" runat="server" OnTextChanged="docTypeSelected" AutoPostBack="true"/> 




and in code behind like that :
docTypeComboBox.EmptyMessage = this.GetLocalResourceObject("docType_emptyListItemResource").ToString(); 
 
                DataTable dt = new DataTable(); 
                dt = buildDocTypeDataTable(dt, list); 
 
                docTypeComboBox.AllowCustomText = true
                docTypeComboBox.DataSource = dt; 
                docTypeComboBox.DataTextField = "Name"
                docTypeComboBox.DataValueField = "Code"
                docTypeComboBox.DataBind(); 

In fact I have nothing to add sorry... I want to do as in the example, that is to say allow the user to filter on the combo box.
In the example, when the user writes some text, caracters become bold and the combo box contains only items which correspond.
In my case, I can write but it doesn't filter, that is to say the combo box contains all items.

thanks for help
0
Seth
Top achievements
Rank 1
answered on 22 Jun 2010, 05:09 PM
What I think you need to do, is on your Page_Load event, set the filter on the RadComboBox:

docTypeComboBox.Filter = <Whatever Your Filter Is>

Then, in the NeedDataSource event of the docTypeComboBox, put your databinding code (no docTypeComboBox.DataBind() is needed).
Tags
Ajax
Asked by
Jean
Top achievements
Rank 1
Answers by
Seth
Top achievements
Rank 1
Jean
Top achievements
Rank 1
Share this question
or