I have a RadGrid which has RadComboBox which are selectable without edit mode and hence the call to SelectedIndexChanged fires correctly just can't seem to extract the index of the item. Yet when I turn the RadComboBox to a regular asp DropDownList it works fine.
Code Behind:
The CommandArgument works fine with dropdownlist but not RadCombo? I need to change the values on the fly rather then having to go to edit mode. Any help would be appreciated.
- Thank You
<
telerik:GridTemplateColumn
DataField
=
"CLASS"
SortExpression
=
"SEP_CW_CRSE_CLASS"
UniqueName
=
"SEP_CW_CRSE_CLASS"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lbCRSEClass"
runat
=
"server"
Visible
=
"false"
Text='<%# Eval("SEP_CW_CRSE_CLASS") %>' />
<
asp:DropDownList
ID
=
"rdbCRSEClass"
runat
=
"server"
Width
=
"75px"
OnSelectedIndexChanged
=
"rdbCRSEClass_SelectedIndexChanged"
AutoPostBack
=
"true"
CommandArgument='<%# ((GridItem)Container).ItemIndex %>' />
<%--<
telerik:RadComboBox
ID
=
"rdbCRSEClass"
runat
=
"server"
OnSelectedIndexChanged
=
"rdbCRSEClass_SelectedIndexChanged"
AutoPostBack
=
"true"
CommandArgument='<%# DataBinder.Eval(Container,"ItemIndex") %>'>
</
telerik:RadComboBox
>--%>
<%--<
telerik:RadComboBox
ID
=
"rdbCRSEClass"
runat
=
"server"
OnSelectedIndexChanged
=
"rdbCRSEClass_SelectedIndexChanged"
AutoPostBack
=
"true"
CommandArgument='<%# ((GridItem)Container).ItemIndex %>'>
</
telerik:RadComboBox
>--%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Code Behind:
//RadComboBoxSelectedIndexChangedEventArgs
protected
void
rdbCRSEClass_SelectedIndexChanged(
object
sender, EventArgs e)
{
string
cmdArg = ((DropDownList)sender).Attributes[
"CommandArgument"
];
//string cmdArg = ((RadComboBox)sender).Attributes["CommandArgument"];
int
ItemIndex = Convert.ToInt32(cmdArg);
DropDownList rdbGEGRAD = (DropDownList)(gvClassTERM.Items[ItemIndex].FindControl(
"rdbGEGRAD"
));
DropDownList rdbCRSEClass = (DropDownList)(gvClassTERM.Items[ItemIndex].FindControl(
"ddltCRSEClass"
));
}
The CommandArgument works fine with dropdownlist but not RadCombo? I need to change the values on the fly rather then having to go to edit mode. Any help would be appreciated.
- Thank You