Hi All,
I have the need to get the selected value from a GridDropDownColumn while the row is not in Edit mode.
My Grid is defined as :
I have a button I click that I then need to fill out an object with the selected rows data. I am able to do so mostly by using the GridDataItem from the MasterTableView.GetSelectedItems(). From there, I access the .Text property of the table cell.
But with a GridDropDownColumn, I am after the Value of the dropdownlist item, not the Text.
How do I access this?
Thanks for any info.
Steele.
I have the need to get the selected value from a GridDropDownColumn while the row is not in Edit mode.
My Grid is defined as :
<
telerik:RadGrid
ID
=
"rgCriterias"
runat
=
"server"
GridLines
=
"None"
OnDeleteCommand
=
"rgCriterias_DeleteCommand"
OnInsertCommand
=
"rgCriterias_InsertCommand"
OnItemCommand
=
"rgCriterias_ItemCommand"
OnItemDataBound
=
"rgCriterias_ItemDataBound"
OnNeedDataSource
=
"rgCriterias_NeedDataSource"
OnPreRender
=
"rgCriterias_PreRender"
OnUpdateCommand
=
"rgCriterias_UpdateCommand"
OnCreateColumnEditor
=
"rgCriterias_CreateColumnEditor"
>
<
ClientSettings
EnableRowHoverStyle
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"True"
ScrollHeight
=
"400px"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"Id,Version,CategoryId"
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"Top"
EditMode
=
"EditForms"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
></
CommandItemSettings
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
>
<
HeaderStyle
Width
=
"8%"
/>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"Sequence"
DataType
=
"System.Int32"
HeaderText
=
"Sequence"
UniqueName
=
"Sequence"
ReadOnly
=
"True"
>
<
HeaderStyle
Width
=
"12%"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Description"
HeaderText
=
"Description"
UniqueName
=
"Description"
>
<
HeaderStyle
Width
=
"15%"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridHTMLEditorColumn
DataField
=
"Notes"
HeaderText
=
"Notes"
UniqueName
=
"Notes"
ConvertEmptyStringToNull
=
"False"
>
<
HeaderStyle
Width
=
"20%"
/>
</
telerik:GridHTMLEditorColumn
>
<
telerik:GridHTMLEditorColumn
DataField
=
"TypicalResponse"
HeaderText
=
"Typical Response"
UniqueName
=
"TypicalResponse"
ConvertEmptyStringToNull
=
"False"
>
<
HeaderStyle
Width
=
"20%"
/>
</
telerik:GridHTMLEditorColumn
>
<
telerik:GridDropDownColumn
DataField
=
"RoleId"
EmptyListItemText
=
"-- Select Role --"
EmptyListItemValue
=
"-1"
EnableEmptyListItem
=
"True"
HeaderText
=
"Role"
ListTextField
=
"desc"
ListValueField
=
"code"
UniqueName
=
"Role"
>
<
HeaderStyle
Width
=
"10%"
/>
</
telerik:GridDropDownColumn
>
<
telerik:GridNumericColumn
DataField
=
"Weighting"
DataType
=
"System.Decimal"
DefaultInsertValue
=
"0"
EmptyDataText
=
"0"
HeaderText
=
"Weighting"
UniqueName
=
"Weighting"
DataFormatString
=
"{0:###.00}"
>
<
HeaderStyle
Width
=
"10%"
/>
</
telerik:GridNumericColumn
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"column1"
ButtonType
=
"ImageButton"
ConfirmDialogType
=
"RadWindow"
>
<
HeaderStyle
Width
=
"5%"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
HeaderContextMenu
EnableImageSprites
=
"True"
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
But with a GridDropDownColumn, I am after the Value of the dropdownlist item, not the Text.
How do I access this?
Thanks for any info.
Steele.