I have the following:
<telerik:GridTemplateColumn DataField="password" > <ItemTemplate> <telerik:RadComboBox runat="server" ID="ddlActions" Skin="Silk" Width="115" AutoPostBack="true" OnSelectedIndexChanged="ddlActions_SelectedIndexChanged"> <Items> <telerik:RadComboBoxItem Value="-1" Text="Select Action" /> <telerik:RadComboBoxItem Value="0" Text="Edit" /> <telerik:RadComboBoxItem Value="1" Text="Opt-out" /> <telerik:RadComboBoxItem Value="2" Text="Save" /> <telerik:RadComboBoxItem Value="3" Text="View" /> </Items> </telerik:RadComboBox> </ItemTemplate></telerik:GridTemplateColumn>
protected void ddlActions_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { RadComboBox rcb = (RadComboBox)sender; GridDataItem data = (GridDataItem)rcb.NamingContainer; string pwd = data.GetDataKeyValue("pwd").ToString(); string rid = data.GetDataKeyValue("rid").ToString(); switch(rcb.SelectedValue) { case "0":.....
The switch works perfectly the first time any radcombobox in the grid is changed. The problem I am having is that when a subsequent radcombobox is changed in a different row, the sender appears to be the first radcombobox which was changed, not the actual (second) changed radcombobox.
How do I work around this?
