Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:18:10+00:00 2026-05-26T12:18:10+00:00

I have the following GridView <asp:GridView ID=grdImoveis runat=server DataSourceID=dsGrid> <Columns> <asp:BoundField HeaderText=Nome DataField=NomeCompleto />

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:18:10+00:00Added an answer on May 26, 2026 at 12:18 pm

    If your asking what I think, you’d like want to handle the OnRowCommand of your GridView and capture the button action in there.

    <asp:GridView ID="grdImoveis" onrowcommand="grdImoveis_RowCommand" ...
    

    Code-Behind:

     protected void grdImoveis_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "BUTTON")
            {
                // Check value of e.CommandArgument and do something here:
            }
        }
    

    And change your imagebutton to something like so by setting CommandName and CommandArgument to the value you want to pass. You also have to wrap it in a TemplateField:

    <asp:TemplateField>
                <ItemTemplate>
    <asp:ImageButton CommandName="BUTTON" CommandArgument='<%#Eval("NomeCompleto") %>' ID="ibtnAlterar" ImageUrl="../tema/_Internas/icons/edit.png" runat="server"  />
    </ItemTemplate></asp:TemplateField>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following gridview: <asp:GridView ID=gdvReport runat=server AutoGenerateColumns=False DataSourceID=sdseport> <Columns> <asp:BoundField DataField=Phone HeaderText=Phone
I have the following GridView in ASP.NET 3.5: <asp:GridView ID=gvTable runat=server AllowSorting=true ShowHeader=true> <Columns>
i have the following gridview <asp:GridView ID=GridView3 runat=server AllowPaging=True AllowSorting=True AutoGenerateColumns=False DataKeyNames=ID DataSourceID=CommentsDataSource> <Columns>
I have the following GridView and ObjectDataSource: <asp:GridView ID=grdTrades runat=server DataSourceID=srcTrades DataKeyNames=tradeId EnablePersistedSelection=true SelectedRowStyle-BackColor=Yellow
I have defined the following in my gridview markup (simplified): <asp:GridView ID=grvReport runat=server DataSourceID=odsReport
I have following Gridview: <asp:GridView ID=GridView1 runat=server CssClass=table DataKeyNames=groupId DataSource=<%# dsUserGroupsSelected %> DataMember=Group etc....>
If I have the following (generic) ASP code: <asp:ObjectDataSource runat=server ID=myODS>...</asp:ObjectDataSource> <asp:GridView runat=server ID=myGV
I have the following code in the columns section of my GridView: <Columns> <asp:boundfield
I have defined a nested grid view in the following way. <asp:GridView ID=GridView1 runat=server
I have a gridview with the following markup: <asp:GridView ID=gv runat=server Width=700px skinid=gridview HeaderStyle-HorizontalAlign=Left

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.