开发者

Accessing radgrid row through object data source

开发者 https://www.devze.com 2023-01-14 12:09 出处:网络
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\">

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 开发者_JAVA技巧radgrid where the drop down list has been changed?


Found it. Thanks!

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

精彩评论

暂无评论...
验证码 换一张
取 消