I am trying to create a RadGrid that shows RadDropDownList in both ItemTemplate and EditTemplate.
When the user clicks on the the dropdown list in ItemTemplate mode and changes the selected item and then clicks off the grid to collapse the dropdown list, the red icon does not appear in the top corner of the cell to show a change has been. When the grid is saved the changes are not saved and the value remains the same as it was before the user made the change.
However if the user clicks on the actual cell (the space on the side of the dropdown list in the same column) then changes the selected item, the red icon appears and the change is saved as expected.
I'm assuming this is because the grid only enters batch edit mode when the cell is clicked but when the dropdown list itself is clicked it remains in the ItemTemplate and shows the dropdown list that is in ItemTemplate mode.
What is the fix for this?
Code:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"sqlDisplayRegisters"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
ShowStatusBar
=
"True"
AllowFilteringByColumn
=
"false"
OnItemCommand
=
"RadGrid1_ItemCommand"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"sqlDisplayRegisters"
DataKeyNames
=
"RegID"
EditMode
=
"Batch"
CommandItemDisplay
=
"Bottom"
NoMasterRecordsText
=
"There are no registers for this selection"
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"false"
SaveChangesText
=
"Submit Register"
ShowCancelChangesButton
=
"false"
ShowRefreshButton
=
"false"
/>
<
CommandItemStyle
Font-Size
=
"Larger"
/>
<
Columns
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"10%"
DataType
=
"System.String"
DataField
=
"P_Forename"
HeaderText
=
"Forename"
SortExpression
=
"P_Forename"
UniqueName
=
"P_Forename"
ReadOnly
=
"true"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
FilterControlWidth
=
"60%"
DataField
=
"Mark"
FilterControlAltText
=
"Filter Mark column"
HeaderText
=
"Mark"
UniqueName
=
"Mark"
SortExpression
=
"Mark"
DataType
=
"System.String"
>
<
HeaderStyle
Width
=
"80px"
HorizontalAlign
=
"Left"
/>
<
ItemTemplate
>
<
telerik:RadDropDownList
runat
=
"server"
ID
=
"ddlMarkItem"
DataSourceID
=
"SqlDataSource1"
DataValueField
=
"Code"
DataTextField
=
"Description"
SelectedValue=<%# Eval("Mark") %> >
</
telerik:RadDropDownList
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDropDownList
runat
=
"server"
ID
=
"ddlMarkEdit"
DataSourceID
=
"SqlDataSource1"
DataValueField
=
"Code"
DataTextField
=
"Description"
>
</
telerik:RadDropDownList
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>