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

pass values from grid to combo box

2 Answers 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 10 Feb 2012, 12:34 PM
hi friend,
i have small problem, but it makes as big issue for me.
my problem is i have grid with data loaded.
on clicking the row of the grid, the data of that particular row should pass to the controls above the grid like radtextbox and radcombobox.
i am using javascript to do this.
i can pass values from radgrid to radtextbox, by using below code.

var interesttype = document.getElementById("rtxtinteresttype");
interesttype.innerText = args.get_gridDataItem().get_cell("interesttype").innerText

but this not working for combo box.
i tried with this one:-
//method 1
 var currency = document.getElementById("rcmbcurrency");
  currency.innerText = args.get_gridDataItem().get_cell("currency_Code").innerText

and this
//method 2
var
item = get_Item().findElement("currencycode").innerHTML;
var items = rcmbcurrencycode.findItemByText(Item);
items.select();

but i cannot bind the data from grid to combo box.
any one can find where i made mistake in this code and how to solve this? or i want to change coding method to pass values from grid to combo box.
thanks in advance
S.Rajkumar

2 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 14 Feb 2012, 11:44 AM
Hi Raj,

When you want to set value or text to the RadComboBox, you should first get reference to its client-side object and not its DOM element.

Please refer to the following help article here, showing the basics on how to work with the RadComboBox's client-side object. Also you could have a look at the following two help article here and here.

All the best,
Dimitar Terziev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Tsvetoslav
Telerik team
answered on 15 Feb 2012, 08:47 AM
Hello Raj,

Attached is a small sample that should provide you with guidelines on your implementation.
 
Regards,
Tsvetoslav
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
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Tsvetoslav
Telerik team
Share this question
or