I have the following GridView
<asp:GridView ID="grdImoveis" runat="server" DataSourceID="dsGrid">
<Columns>
<asp:BoundField HeaderText="Nome" DataField="NomeCompleto" />
<asp:ImageButton ID="ibtnAlterar" ImageUrl="../tema/_Internas/icons/edit.png" runat="server" OnClick="btnChange_Click" />
</Columns>
</GridView>
How can i get the value of this field in code behind and pass the value to my btnChange_Click event ?
If your asking what I think, you’d like want to handle the OnRowCommand of your GridView and capture the button action in there.
Code-Behind:
And change your imagebutton to something like so by setting
CommandNameandCommandArgumentto the value you want to pass. You also have to wrap it in a TemplateField: