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

Changing textbox value on ClientSide

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
taeho
Top achievements
Rank 1
taeho asked on 24 Nov 2008, 10:26 AM
I have a radGrid and its columns get created all server side dynamically.
The grid has 3 columns and each column contains a textbox.
On client-side, the first textbox value needs to be changed according to the inputs of the second and the third textboxs.
This javascript function has those three column names.
Inside the function I can get innerHTML values of all three controls by doing

GridControl.GetCellByColumnUniqueName(selectedRow, thefirstTextBoxColumnName).innerHTML

GridControl.GetCellByColumnUniqueName(selectedRow, thesecondTextBoxColumnName).innerHTML

GridControl.GetCellByColumnUniqueName(selectedRow, thethirdTextBoxColumnName).innerHTML

Firstly, are there any ways of extracting only values from innerHTML strings without having to create a complex string manipulation to get only values?

Secondly, how do I assign a value to the first textbox?
If I do
GridControl.GetCellByColumnUniqueName(selectedRow, thefirstTextBoxColumnName).innerHTML = 1 + 2;
the column becomes label rather than staying in input textbox.

Thanks in advance,

Toby

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 25 Nov 2008, 02:57 PM
Hi taeho,

Once you get a reference to the cell, you need to access the nested control.
Attached to this message, is a small application, which demonstrates the approach in question.
I hope it helps!

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
taeho
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or