This is a migrated thread and some comments may be shown as answers.

OnBatcheditopen event of rad grid

6 Answers 158 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shashi
Top achievements
Rank 1
shashi asked on 09 Jun 2016, 02:28 AM

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.

6 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Jun 2016, 09:19 PM
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.
0
shashi
Top achievements
Rank 1
answered on 14 Jun 2016, 07:27 PM

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.

0
Pavlina
Telerik team
answered on 17 Jun 2016, 08:41 PM
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.
0
shashi
Top achievements
Rank 1
answered on 20 Jul 2016, 04:40 AM

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.

 

0
Accepted
Pavlina
Telerik team
answered on 22 Jul 2016, 10:01 PM
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.
0
shashi
Top achievements
Rank 1
answered on 25 Jul 2016, 02:54 AM

Thanks a lot !!!!

last line was giving the issue .

After removing it ,code is working as expected.

 

thanks again !!!

Tags
Grid
Asked by
shashi
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
shashi
Top achievements
Rank 1
Share this question
or