codingTornado
codingTornado

Reputation: 113

Dynamicaly input values into webdatagrid rowadding

I'm attempting to input some values into the grid's new row template from outside the grid since selecting this particular input would be more than impractical to get done from inside de webdatagrid.

How can I reach the to be added row via javascript from outside the control? According to the documentation ig_controls.wdgTransaccion.get_behaviors().get_editingCore().get_behaviors().get_rowAdding().get_row(); should do the trick, but it fails to return any row at all

Thank you

Upvotes: 0

Views: 2969

Answers (1)

Damyan Petev
Damyan Petev

Reputation: 1635

Are you sure you calling this from the right place? Can't really tell without more context, however I think i can help you get the functionality you need. Have a look at this sample:

ASP.NET Data Grid: Add New Row - Client Events

The best place I can think of doing this is probably at the time of actual editing happening, so have a look at the EnteringEditMode event and you can do the following inside:

     function WebDataGridView_EnteringEditMode(webDataGrid, evntArgs) {
               webDataGrid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding().get_row().get_cell("1").set_value("test");             
}

Or if you want to do it on your own flow you can grab the grid client object and use the same code as the event above:

var webDataGrid = $find('<%=WebDataGrid1.ClientID%>');
    webDataGrid.get_behaviors().get_editingCore().get_behaviors().get_rowAdding().get_row().get_cell("1").set_value("test");

Both of those methods work and allow you to fill in a cell value.

Upvotes: 1

Related Questions