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
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
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.
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
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.
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.
Pavlina
Telerik by Progress
Thanks a lot !!!!
last line was giving the issue .
After removing it ,code is working as expected.
thanks again !!!