Hi Team,
I have a column(Template data field - item template - web drop down) in web data grid.
I want to get selected row when we select an item in web dropdown from client side.
Added below code to web drop down in template data field.
ClientEvents SelectionChanged="ddl_SelectionChanged
function ddl_SelectionChanged(sender, eventArgs) { var grid = $find("<%= gvParams.ClientID %>"); var rows = grid.get_rows(); alert("rows" + rows.get_length()); var rowSelected = grid.get_behaviors().get_selection().get_selectedRows(); alert("selected" + rowSelected); //grid.Rows.refresh(); }in the above method i am getting null value in rowSelected variable.I want to get the selected value in drop down and selected row index.Please do the needful
Regards,
Sravani
Hello chinni nani ,
Thank you for posting in our forum.
I’ve looked into this and it seems that in this scenario the WebDropDown will take the focus from the grid so the active cell and the selected row will not be changed when you open the drop down.
If you had selected another row before you open the drop down then that’s the row the will be returned inside the selectedRows on the client side.
If you want to get the row the drop down belongs to you could get it from the parent dom elements since each WebDropDown in this case will be nested in a cell. So for example:
function dd_SelectionChanged(sender, e) {
var parentRow = sender.get_element().parentElement.parentElement._object.get_index();
var selectedRowIndex= sender.get_element().parentElement.parentElement._object.get_index()
alert(selectedRowIndex);
}
This would get the row element which is the second parent of the WebDropDown (the first is the cell). From it it gets the row object and displays an alert with the row index.
Let me know if you're trying to achieve something similar.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Hi Maya,
Thanks for the reply. We are able to get the selected row.
We have one dropdown or web provider as a column and one grid as a column(Means we have nested grids).
Example: grid.column[1] = dropdown and grid.columm[2] = internalgrid
How can we get that internal grid object from client side and change the data based on dropdown selection.
Example: If we select 0th value from dropdown, then we need add dropdown column to internal grid. if we select 2nd value then we need to add text box field column to that specific row in main grid.
The above functionality should reflect on particular row.
Now we want to get the grid object which was inserted in another cell like dropdown.
Can we use jquery or xmlhttprequest objects to get data for internal grid. If so please provide me a pseudo code and also from where we need to call that function..
If you have any information regarding this please let us know.
Hello Sravani,
It seems that you’ve already discussed this with another developer support engineer in the following thread:
http://es.infragistics.com/community/forums/t/78261.aspx
She has suggested a way to change the grid data on the WebDropDown’s selection changed event and also a way to execute a callback on the client side for the grid.
She has also provided a working sample for your reference. If you have any questions on it you can let her know in the other thread.