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

RadWindow with ContentTemplate isn't giving me the selected RadComboBox item

2 Answers 43 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kathy
Top achievements
Rank 1
Kathy asked on 24 Dec 2010, 01:32 AM
I have a RadWindow with several RadComboBox controls.  I'm using javascript to get the selected value from these ComboBoxes.  It's pretty simple code:

function OK_Clicked() {
            var oWindow = GetRadWindow();
            //Get current item
           var combo = <%= RadComboBox1.ClientID %>;
           var combotext = combo.valueOf();
           alert(combotext);
}
The combo is getting populated by a datasource.  Yet, it says object doesn't support this property or method ( the valueOf() call ).  All I'm trying to do is get the selected item.  Do I need to have an event on this combo, on the client side to note when the selected index changes?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Dec 2010, 05:25 AM
Hello,

You need to use $find() method to get the combo client object.
Client-Side Basics


And refer the following documentations which would help you to get selected item value.
RadComboBox object
RadComboBoxItem object


-Shinu.
0
Svetlina Anati
Telerik team
answered on 24 Dec 2010, 02:51 PM
Hello Kathy,

 Please note the following:

1) When you are using ContentTemplate you do not need the GetRadWindow() function - this function is used to reference a RadWindow from inside its content page when another page is loaded. In the case of ContentTemplate you have all the content on the same page and using this function could cause an error.

2) As Shinu pointed out, to reference a client AJAX object you should use the $find syntax.

I hope that my reply is helpful and for your convenience I prepared and attached a sample demo for you. I also recommend to examine the RadWindow demos below to get a better understanding on how to use the control:

http://demos.telerik.com/aspnet-ajax/window/examples/overview/defaultcs.aspx

Happy holidays!

Greetings,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
Kathy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or