Hi Guys,
I have used RadGrid with batchupdate. I have datalist, When I choose one item from DataList (Product code, Name, Quantity, Quom..), I want to add a new row into Radgrid and auto fill product code, name, quantity.. that I had chossen from Datalist.
I have function below:
I$("[id*=btnAddNewD]").live("click", function () {
var prdccode = $("[id*=lblPrdcCode]", $(this).closest("table")).html();
var prdcname = $(this).parent().parent().parent().find("input[type=hidden]").val();
addNewItem(prdccode, prdcname);
return false;
});
function addNewItem(prdccode, prdcname) {
var grid = $find('<%=RadGrid1.ClientID%>');
var grid_master = grid.get_masterTableView()
var grid_batchmanager = grid.get_batchEditingManager()
grid_batchmanager.addNewRecord(grid_master);
var newItem = grid_master.get_dataItems()[0]
var v_prdccode = newItem.get_cell("PrdcCode");
var newItem1 = grid_master.get_dataItems()[0]
var v_prdcname = newItem1.get_cell("MPrdcNme");
setTimeout(function () {
grid.get_batchEditingManager().changeCellValue(v_prdccode, prdccode); => change
grid.get_batchEditingManager().changeCellValue(v_prdcname, prdcname); => Not change
}, 0);
}
...but only first column was changed value. please help me.
Thanks.