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

[Solved] Get row data when ComboBox in TemplateColumn is selected

1 Answer 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 06 Oct 2009, 06:13 PM
I've populated a GridTemplateColumn with a RadComboBox.  When an option in the combobox is selected, I'm catching the OnClientSelectedIndexChanged event.  I need to know which row this has occurred in, on the client-side.  I can get the actual combobox control and the grid control using the 'sender' parameter, but I can't figure out how to get the row object so that I can get some other data out of another column in that row.

Again, I want to do all of this client-side.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Oct 2009, 07:04 AM
Hello Ryan,

You can try out the following code to access teh parent row of the combobox and thereby access another cell in that row:
js:
function ClientSelectedIndexChanged(sender, args) 
    {       
       var row = sender.get_element().parentNode.parentNode;       
       var grid = $find("<%=RadGrid1.ClientID %>"); 
       var MasterTable = grid.get_masterTableView(); 
       var celltext = row.cells[4].innerHTML
       alert(celltext); 
    } 

Thanks
Princy.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or