OnBatcheditopen event of rad grid

7 posts, 1 answers
  1. shashi
    shashi avatar
    24 posts
    Member since:
    Jan 2016

    Posted 08 Jun Link to this post

    Hi , I have a dropdown list inside the edit template and a label on template item. I am tiring to find this control on batcheditopening event . I want to insert the label value as the last list item of the dropdown listI. I am able to find the label value but I am having issue in finding the dropdown.

    please help me with this issue.

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Jun Link to this post

    Hello,

    You can refer to the article below for more information on the matter:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-batch-edit-mode

    and the following forum thread:
    http://www.telerik.com/forums/how-to-find-control-inside-radgrid-with-out-defining-the-field-as-datakeyname#c4BzjVaR0EKUfasiu1dyHw

    Give them a try and let me know if you still encounter any problems.

    Regards,
    Pavlina
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. shashi
    shashi avatar
    24 posts
    Member since:
    Jan 2016

    Posted 14 Jun in reply to Pavlina Link to this post

    Thanks for the reply.

    I am able to find dropdown list on batcheditopened event but I am not able to append any new list item on it.

    it doesn't recognize add or append function. Please help me with this .

    Can you please provide sample code for it.

     

    Thanks in advance.

  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 17 Jun Link to this post

    Hi,

    You can call RadGrid.get_batchEditingManager().addNewRecord in order to append a new tr element:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/client-side-api

    Regards,
    Pavlina
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  6. shashi
    shashi avatar
    24 posts
    Member since:
    Jan 2016

    Posted 19 Jul Link to this post

    I was able to solve this issue by using 

    function BatcheditOpened(sender, args) {             

                   var row = args.get_row();
                    var cell = args.get_cell();
                    var dataItem = $find(args.get_row().id);
                    var idnCaseval = dataItem.get_cell("IDN_CASE").innerText || dataItem.get_cell("IDN_CASE").textContent;

                    var columnUniquename = args.get_columnUniqueName();
                    var indexval = columnUniquename.split('_');
                    var labelval = $telerik.findElement(row, "lblday" + indexval[4]).attributes["expected"].nodeValue;
                    var dropdown1 = $telerik.findElement(cell, "ddCareUnit" + indexval[4]);

    //If I use the below code of line editor does not close in Fire fox and Chrome until i click on the other row column
                    if (dropdown1.length > 9) {
                        dropdown1.remove(9);
                    }
                    var opt1 = document.createElement("option");
                    opt1.value = labelval;
                    opt1.text = "CCIS Schedule: " + labelval;
                    dropdown1.add(opt1);
                    dropdown1(9).setAttribute("style", "gray !important;font:normal normal bold 13.333333015441px/normal Arial;");

                }

     

    It is working fine in IE.

    But in chrome and firefox editor does not close.

    I am using batch edit mode with <BatchEditingSettings EditType ="cell" OpenEditingEvent="MouseOver" /> setting.

     

    Please help me solve this.

     

  7. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Jul Link to this post

    Hello,

    I assume that if you inspect your browser's console you will notice that a JavaScript error is thrown which most probably prevents editor to close.
     
    Regards,
    Pavlina
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  8. shashi
    shashi avatar
    24 posts
    Member since:
    Jan 2016

    Posted 24 Jul in reply to Pavlina Link to this post

    Thanks a lot !!!!

    last line was giving the issue .

    After removing it ,code is working as expected.

     

    thanks again !!!

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017