BatchEditing Error !

2 posts, 0 answers
  1. phong
    phong avatar
    1 posts
    Member since:
    Jun 2016

    Posted 07 Jun Link to this post

    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()

                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. 


  2. Eyup
    Eyup avatar
    2942 posts

    Posted 12 Jun Link to this post

    Hello Phong,

    When you make the desired selection, you can access the given column of the grid:

    Then cast it to GridBoundColumn, GridNumericColumn, etc. and set its DefaultInsertValue property.

    Essentially, Batch editing is different than other modes. You can find a detailed explanation in the following section:

    Alternatively, you can try using the following event handler to intercept the cell and modify its value:

    I hope this will prove helpful.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top