Hello,
i use WebDataGrid Version 11.1.20111.2064 with Asp.Net 4.x. The grid is bound to a SqlDataSource, AutoCRUD is enabled and if i change a value in a cell, the update is working correct.
But if i try to set the set the value of a cell via a javascript function, the 'Text' in the call is changed, but the bound value in the datasource is not changing!!
function wdg_POI_Selection_RowSelectionChanged(sender, eventArgs) { // use the function to get a reference on the grid and the akt_row if (akt_grid == null) akt_grid = sender;
// Select row akt_rows = eventArgs.getSelectedRows(); akt_Index = akt_rows.getItem(0).get_index(); akt_Row_ID = akt_rows.getItem(0).get_cell(0).get_text();
}
function click_Koord() { if (akt_rows != null) { akt_Lat = $get("tb_Lat").value; akt_Lon = $get("tb_Lon").value; var Koordinate = "POINT (" + akt_Lon + " " + akt_Lat + ")"; //akt_rows.getItem(0).get_cell(7).set_text(Koordinate); akt_grid.get_rows().get_row(akt_Index).get_cell(7).set_text(Koordinate); //akt_grid.get_behaviors().get_activation().set_activeCell(7);
var editingCore = akt_grid.get_behaviors().get_editingCore(); editingCore.commit();
} }
I try to change the akt_grid or the akt_row! The text in the cell is allways changed as excpected. But the DataSource is not updated.
Any solution for this problem?
Ok, i solved my problem!
akt_grid.get_rows().get_row(akt_Index).get_cell(7).set_value(Koordinate); not set_text() !! This did the job!
akt_grid.get_rows().get_row(akt_Index).get_cell(7).set_value(Koordinate);
not set_text() !!
This did the job!
Hello page,
Thank you for posting your solution to the forum, in this way it will be helpful for other users with the same question too.
Hi ,
Could you please tell me how can i update the content of the newly added row to the database.
Regards,
Hsakarp.
Hello Hsakarp,
i use a SqlDatasource with Stored Procedures and bound each SP to the Select-, Insert- and Update- Command. If you use Auto-Crud on the Grid all 'event-Handling' is out of your way, so if you change a value in a cell, the grid use the update proc and then the select proc and refill the grid.
Hope this helps.
Patric