Hi,
Telerik controls version: 2014.2.724.45
I have a RadGrid with EditMode="Batch". This RadGrid has a GridTemplateColumn with a RadComboBox in EditItemTemplate. If a description with a special character (<, >, ...) appears in RadComboBox, OldValues in BatchEditCommand has an incorrect value.
Modify Comment field and click Save button. In NewValues["ID_SLOT"] you can see value 4,5 (incorrect).
Another issue OldValues["ID_SLOT"] is not present.
Thanks in advance.
Alfonso
Telerik controls version: 2014.2.724.45
I have a RadGrid with EditMode="Batch". This RadGrid has a GridTemplateColumn with a RadComboBox in EditItemTemplate. If a description with a special character (<, >, ...) appears in RadComboBox, OldValues in BatchEditCommand has an incorrect value.
Modify Comment field and click Save button. In NewValues["ID_SLOT"] you can see value 4,5 (incorrect).
Another issue OldValues["ID_SLOT"] is not present.
<
telerik:RadCodeBlock
ID
=
"mainRadCodeBlock"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function saveChanges() {
var grid = $find("<%=GridExample.ClientID %>");
grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
}
</
script
>
</
telerik:RadCodeBlock
>
<
asp:Button
ID
=
"btnSave"
runat
=
"server"
Text
=
"Save"
ToolTip
=
"Save changes to database"
OnClientClick
=
"saveChanges();return false;"
/>
<
telerik:RadGrid
ID
=
"GridExample"
runat
=
"server"
AutoGenerateColumns
=
"false"
Skin
=
"Simple"
AllowPaging
=
"False"
AllowSorting
=
"false"
AllowFilteringByColumn
=
"true"
OnBatchEditCommand
=
"GridExample_BatchEditCommand"
OnNeedDataSource
=
"GridExample_NeedDataSource"
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
SaveScrollPosition
=
"true"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
HeaderStyle-HorizontalAlign
=
"Center"
Width
=
"100%"
AutoGenerateColumns
=
"false"
DataKeyNames
=
"ID_COUNTRY"
EditMode
=
"Batch"
>
<
BatchEditingSettings
EditType
=
"Cell"
OpenEditingEvent
=
"MouseOver"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"COMMENTS"
HeaderText
=
"Comments"
HeaderTooltip
=
"Comments"
HeaderStyle-Width
=
"100px"
ItemStyle-Width
=
"100px"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"false"
FilterControlWidth
=
"100%"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"false"
FilterControlWidth
=
"100%"
UniqueName
=
"SLOT"
HeaderText
=
"Slot"
DataType
=
"System.Int32"
DataField
=
"ID_SLOT"
SortExpression
=
"SLOT"
ColumnGroupName
=
"Devices"
HeaderStyle-Width
=
"150px"
ItemStyle-Width
=
"150px"
>
<
ItemTemplate
>
<%# Eval("SLOT") %>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"ddlSLOT"
runat
=
"server"
EnableLoadOnDemand
=
"true"
Filter
=
"Contains"
AllowCustomText
=
"false"
DataTextField
=
"SLOT"
DataValueField
=
"ID_SLOT"
OnItemsRequested
=
"ddlSLOT_ItemsRequested"
Style
=
"width: 135px;"
class
=
"caronte-portfolio-ddl-slot"
>
</
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
GridExample_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
DataTable table =
new
DataTable();
table.Columns.Add(
"ID_COUNTRY"
,
typeof
(
int
));
table.Columns.Add(
"COMMENT"
,
typeof
(
string
));
table.Columns.Add(
"ID_SLOT"
,
typeof
(
int
));
table.Columns.Add(
"SLOT"
,
typeof
(
string
));
DataRow row =
null
;
for
(
int
i = 0; i < 5; i++)
{
row = table.NewRow();
row[
"ID_COUNTRY"
] = i;
row[
"ID_SLOT"
] = 1;
row[
"SLOT"
] =
"Flagship < 4,5\" SP"
;
table.Rows.Add(row);
}
(sender
as
RadGrid).DataSource = table;
}
protected
void
ddlSLOT_ItemsRequested(
object
sender, RadComboBoxItemsRequestedEventArgs e)
{
DataTable table =
new
DataTable();
table.Columns.Add(
"ID_SLOT"
,
typeof
(
int
));
table.Columns.Add(
"SLOT"
,
typeof
(
string
));
DataRow row = table.NewRow();
row[
"ID_SLOT"
] = 1;
row[
"SLOT"
] =
"Flagship < 4,5\" SP"
;
table.Rows.Add(row);
RadComboBox ddlSlot = sender
as
RadComboBox;
ddlSlot.DataSource = table;
ddlSlot.DataBind();
}
protected
void
GridExample_BatchEditCommand(
object
sender, GridBatchEditingEventArgs e)
{
foreach
(GridBatchEditingCommand command
in
e.Commands)
{
}
}
Thanks in advance.
Alfonso