views:

15

answers:

1

Hello all.

I have a radgrid and within said radgrid, I have a templatecolumn that is a lovely drop down list:

<telerik:GridTemplateColumn HeaderText="Feedback" UniqueName="Feedback">
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlFeedback" runat="server" AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="ddlFeedback_SelectedIndexChanged">  
                               </asp:DropDownList>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

I have a column in my radgrid that is the primary key and it has a lovely value in it.

How can I get the primary key value from the radgrid on the SelectedIndexChanged event of the drop down list i.e. essentially finding the row of the radgrid where the drop down list has been changed?

A: 

Found it. Thanks!

DropDownList ddlFeedback = (DropDownList)sender;
            GridDataItem item = (GridDataItem)ddlFeedback.NamingContainer;
            String prikey = item.GetDataKeyValue("PriKey").ToString();
Ricardo Deano