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

Client Side Drop Down List Reference

3 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Loi
Top achievements
Rank 1
Loi asked on 28 Jul 2008, 01:53 PM
Hi All,

I have a column inside my grid that hold a drop down list.  On client side or in a Javascript function, anyone know a correct way to make a reference to that drop down list?

This is what I have in my code:

var grid = <%= rgDRFormASPPFCaseInfo.ClientID %>;

var tableView = grid.MasterTableView;

var ID = tableView.GetCellByColumnUniqueName(tableView.Rows[RowIndex],"ID").innerHTML;

var ddlList = tableView.GetCellByColumnUniqueName(tableView.Rows[RowIndex],"Answer");

Please help

Thanks

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jul 2008, 05:43 AM
Hi Loi,

Is the DropDownList inside a GridTemplateColumn? Check out the code library submission which shows how to access a control in the grid template on the client side.
Accessing server controls in a grid template on the client

Shinu.


0
newbie
Top achievements
Rank 1
answered on 14 Aug 2008, 09:13 PM
the example specified does not work for me.

Can you give another example where theis scenario is implemented.

I want to find a dropdownlist in the edititemtemplate of a grid on clientside on the click of another dropdownlist in the same row.
0
Yavor
Telerik team
answered on 15 Aug 2008, 05:07 AM
Hi,

although the dropdown in the editForm is accessible on the client, the approach is not very straightforward. Therefore, I would suggest that you use the server ItemDataBound event handler, to get a reference to the editForm item, and then assign the ClientId to a hidden input on the page. Accessing the hidden input through client side code, later on, will give you access to the desired element(s).
I hope this suggestion helps.

Greetings,
Yavor
the Telerik team

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