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

RadNumericTextBox with put in the id of control "_text"

1 Answer 76 Views
Input
This is a migrated thread and some comments may be shown as answers.
fan
Top achievements
Rank 1
fan asked on 19 Feb 2012, 02:37 PM
Hi,
I'm using asp.net ajax tool and I create dynamically 3 RadNumeric TextBoxes with names  RadNumTxt1, RadNumTxt2, RadNumTxt3. 
I create the Text Boxes as follow:
            for (int i = 1; i <= 3; i++){
                    RadNumericTextBox RadNumTxt = new RadNumericTextBox();
                    RadNumTxt .ID = "RadNumTxt" + i;
                    RadNumTxt.AllowOutOfRangeAutoCorrect = true;
                    RadNumTxt.Culture.CultureTypes.Equals("en-US");
                    RadNumTxt.DataType.BaseType.Equals("System.Double");
                    RadNumTxt.Display = true;
                    RadNumTxt.Enabled = true;
                    RadNumTxt.Visible = true;
                    RadNumTxt.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                    PanelCompMembers.Controls.Add(RadNumTxt);
            }
After rendering the page in browser the ids of the  Numeric Texts Boxes have been changed into RadNumTxt1_text, RadNumTxt2_text, RadNumTxt3_text. 

When I try to change the value of these inputs with javascript in client by using the new ids of the inputs like "RadNumTxt1_text" I change them, but when click on them the values that I have change disappeared.  What I am doing wrong?

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 22 Feb 2012, 08:50 AM
Hi fan,

Changing the ID of the HTML elements in the controls is not supported. The control requires specific element IDs to be able to manipulate successfully manipulate the DOM. By the way, can you, please, verify the version of RadControls you are using? In version Q1 2012, we've introduced the so-called "single input rendering", where your visible textbox no longer has "_text" appended to its ID.

Veli
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Input
Asked by
fan
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or