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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:12:33+00:00 2026-06-01T18:12:33+00:00

How can i add cell in specific column for each row in gridview,i want

  • 0

How can i add cell in specific column for each row in gridview,i want to use RowCreated Events.

i have gridview that has 3 columns (ProductName, Price, Count) i get (ProductName, Price) from database, and i want to add value for (count), ex: (Kitkat, 2$ ) i want to add number 5 to (count) column, i want to handle this operation when each row created.

Thanks

  • 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-06-01T18:12:34+00:00Added an answer on June 1, 2026 at 6:12 pm

    Since you haven’t shown your markup, I’m going to assume (based on your comment) that the first two columns are <BoundFields>. If that’s the case, I would add a third column as a <TemplateField>, place a Label in it, and use the RowDataBound event to add the correct number to the Label.

    Here is what the markup would look like:

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        onrowdatabound="GridView1_RowDataBound">
        <Columns>
            <asp:BoundField DataField="ProductName" HeaderText="Product Name" />
            <asp:BoundField DataField="Price" HeaderText="Price" />
            <asp:TemplateField HeaderText="Count">
                <ItemTemplate>
                    <asp:Label ID="countLbl" runat="server"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    
    </asp:GridView>
    

    And the code-behind:

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        Label countLbl = (Label)e.Row.FindControl("countLbl");
        //Your logic for what number to use should go here, I'm just defaulting to 5.
        countLbl.Text = "5";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok i have a table view that can add and delete cells. For each
i have a UItableView and i have two buttons on each cell. You can
I have 10 UITableViewCells in my UITableView . Each cell has a UITextField .
Currently, I have a table view that the user can add items and delete
I have a class that is deriveded from DataGridViewTextBoxCell and I want to add
I have written a macro that to return specific values in one cell based
I want to add an automatic favorites feature that works like this: I have
I know that I can add a HintPath to an external DLLs to help
You can add and subtract 1 from my cell.textLabel.text . I am adding 1
I have a UItableView I can add and delete cells. I can change the

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.