I have an ASP.NET GridView with a DropDownList (in an Item Template) and a ButtonField.
<my:GridView AutoGenerateColumns="false" ID="CurrentCardGrid" UseHighlights="False" runat="server" Width="100%">
<Columns>
<asp:BoundField HeaderText="ID" ItemStyle-Width="50px" DataField="Id" />
<asp:TemplateField HeaderText="" ItemStyle-Width="150px">
<ItemTemplate>
<asp:DropDownList runat="server" ID="StatusList" Width="140px">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField Text="Update" ButtonType="Button" CommandName="Update" />
</Columns>
</my:GridView>
In code, I fill the drop list and capture the RowCommand event.
My question is, in the RowCommand event handler, how do I get the current row? I need to get the value from the drop list and set the status of the row (pointed to by the ID) to the value from the drop list. Note, the row will not be in update mode.
Thanks in advance!
Tom