5 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 18 Jul 2013, 09:10 AM
Hi Helen,
Please try the below code snippet which shows batch editing with color picker.
ASPX:
Thanks,
Shinu
Please try the below code snippet which shows batch editing with color picker.
ASPX:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"false"
DataSourceID
=
"SqlDataSource2"
GridLines
=
"None"
AllowPaging
=
"true"
>
<
MasterTableView
EditMode
=
"Batch"
CommandItemDisplay
=
"Top"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"OrderID"
DataField
=
"OrderID"
HeaderText
=
"OrderID"
/>
<
telerik:GridBoundColumn
DataField
=
"ShipCity"
HeaderText
=
"ShipCity"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"ColorPicker"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"ColorLabel"
runat
=
"server"
Text
=
'Color Picker'
></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadColorPicker
ID
=
"RadColorPicker1"
runat
=
"server"
ShowIcon
=
"true"
>
</
telerik:RadColorPicker
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Thanks,
Shinu
0

Helen
Top achievements
Rank 1
answered on 22 Jul 2013, 04:15 PM
Thanks, I have tried this and can't get it to work - I get no red triangle and the e.Commands.Count remains at 0 in my BatchEditCommand sub so nothing gets updated.
0
Accepted
Hi Helen,
In scenarios like the described things should be handled manually. In order to make things work you will need to subscribe to the OnBatchEditGetCellValue,OnBatchEditSetCellValue,OnBatchEditGetEditorValue and OnBatchEditSetEditorValue event like explained here. Additionally I have prepared a small website which demonstrate a possible realization of the scenario. The example provided should help you resolve the problem.
Regards,
Angel Petrov
Telerik
In scenarios like the described things should be handled manually. In order to make things work you will need to subscribe to the OnBatchEditGetCellValue,OnBatchEditSetCellValue,OnBatchEditGetEditorValue and OnBatchEditSetEditorValue event like explained here. Additionally I have prepared a small website which demonstrate a possible realization of the scenario. The example provided should help you resolve the problem.
Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0

Helen
Top achievements
Rank 1
answered on 02 Sep 2013, 04:22 PM
Getting closer....
I'm having trouble with the insert. Both the OnBatchEditGetCellValue and OnBatchEditSetCellValue return null from $telerik.findElement(container, "ColorLabel").
These lines are fine for updates - just not working for inserts. I am working with master pages.
Thanks
I'm having trouble with the insert. Both the OnBatchEditGetCellValue and OnBatchEditSetCellValue return null from $telerik.findElement(container, "ColorLabel").
These lines are fine for updates - just not working for inserts. I am working with master pages.
Thanks
0
Hi Helen,
Indeed the example previously provided will not work for insert items. In order to resolve the matter the JavaScript logic should be modified. In general the edit and insert items can be distinguished by their ids. The insert items contain a "-" in their id. By using this indicator one can execute different logic to achieve the result which he is after. Please find the modified website which now works as expected.
Regards,
Angel Petrov
Telerik
Indeed the example previously provided will not work for insert items. In order to resolve the matter the JavaScript logic should be modified. In general the edit and insert items can be distinguished by their ids. The insert items contain a "-" in their id. By using this indicator one can execute different logic to achieve the result which he is after. Please find the modified website which now works as expected.
Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.