Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Adding selected row in other grid
posted

Hi,

There are two Webdatagrids in my project. I want to get the cell values from top grid and set the value in new row in the bottom grid.There are some cells common in both the grids where the cell value will be set.This is just to add the selected row from top grid in bottom grid on click of button.

var templateGrid = $find("<%=WebDataGrid1.ClientID%>"); //top grid

var gridBehaviors = templateGrid.get_behaviors();
var template_row = gridBehaviors.get_selection().get_selectedRows().getItem(0);

var gridBehaviors = templateGrid.get_behaviors();


var instanceGrid = $find("<%=WebDataGrid2.ClientID%>"); //bottom grid

var newRow = new Array("EI_ID", "EP_NAME", "EP_ID", "CR_PAGENUM", "EI_GRAPH_SCALE");// the column in bold are common in both grids

instanceGrid.get_rows().add(newRow);

template_row.get_cellByColumnKey("EP_NAME").get_value();

For eg. I want to set the value of "EP_NAME" from top grid to "EP_NAME" column in bottom grid.

I want to add the selected row from top grid  in the bottom grid. How can I achieve this?