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 611651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:48:26+00:00 2026-05-13T17:48:26+00:00

I am working on a app where i need to get the click event

  • 0

I am working on a app where i need to get the click event of a button in gridview. I am not getting it in row command may be because i am adding it dynamically as follows:

protected void gviewTemplate_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        if (e.Row.Cells[1].Text != e.Row.Cells[2].Text)
        {
            e.Row.BackColor = System.Drawing.Color.Red;
            LinkButton lbtnReload = new LinkButton();
            lbtnReload.CommandArgument = e.Row.Cells[12].Text;
            lbtnReload.Attributes.Add("onclick", "javascript:ShowDiv()");
            lbtnReload.CommandName = "reload";
            lbtnReload.Text = "Reload";
            e.Row.Cells[1].Controls.Add(lbtnReload);

            DataTable dt = (DataTable)ViewState["update"];
            DataRow dr = dt.NewRow();
            dr["id"] = e.Row.Cells[0].ToString();
            dr["image"] = e.Row.Cells[1].ToString();
            dt.Rows.Add(dr);
        }
    }
}

protected void gviewTemplate_RowCommand(object sender, GridViewCommandEventArgs e) 
{ 
    if (e.CommandName == "reload") 
    { 
        hdnfield.value = int.Parse(e.CommandArgument.ToString()); 
    } 

    btnFuImage.Visible = true; fuploadImage.Visible = true; 
} 

I have displlayed it in gridview in following manner

<asp:BoundField ItemStyle-Width="100" DataField="Uploded" HeaderText="Uploaded Image" >  

I need to get values from first column of this grid and update it into some hidden variable so that i can use it later. How will i do it. Thanks in advance

  • 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-13T17:48:27+00:00Added an answer on May 13, 2026 at 5:48 pm

    For a button, use a ButtonField and specify a commandname, which will fire the rowcommand event. BoundField doesn’t render a button. If you want to click a boundfield, that’s a more specialized setup…

    Which are you trying to use as the click?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a web app and I need to get a div to
I'm working on an app for Android, I need to get a flux from
I'm working on an app where I need to query Google for businesses near
I am working on an app where I need to save a part of
I am working on an app where I need to refer to an intent,
I'm working on a WinForms app and need to record the location of MouseDown
I am working on a small app where I need to remove the starting
I'm working with an existing Android app and I need to have a dynamically
So I am working on a book tracking app and I need to store
I am working on an app in Windows 8 Metro Style app. I need

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.