RadComboBox in Gridtemplatecolumn

2 posts, 0 answers
  1. Joel
    Joel avatar
    185 posts
    Member since:
    Oct 2006

    Posted 17 Nov 2016 Link to this post

    I have the following:


    <telerik:GridTemplateColumn DataField="password" >
                         <telerik:RadComboBox runat="server" ID="ddlActions" Skin="Silk" Width="115" AutoPostBack="true" OnSelectedIndexChanged="ddlActions_SelectedIndexChanged">
                        <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" />



    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();
                    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?










  2. Patrick
    Patrick avatar
    230 posts

    Posted 18 Nov 2016 Link to this post

    Hello Joel,

    I was unable to replicate the issue, but I have attached a working project using the approach you've described.  

    If your application continues to not work, please include more details including code.

    I hope clear things!

    Telerik by Progress
    Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Back to Top