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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:37:50+00:00 2026-05-22T15:37:50+00:00

I have a GridView with 4 columns and I would like to edit one

  • 0

I have a GridView with 4 columns and I would like to edit one row in a selected column on a button click, I want to replace my value in the column from ON to OFF, as my button says.

So when I click the OFF button the column “STATUS” will be changed to OFF from ON.

Please help 🙂

  • 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-22T15:37:51+00:00Added an answer on May 22, 2026 at 3:37 pm

    There are sooooo many tutorials on this.

    This is one of the most basic operations with a GridView, did you ever Google it?

    You can see here to start and then learn more what you can do with the GridView here


    Assuming you are using jQuery to simplify the code

    <asp:button id="btnOnOff" 
                runat="server" 
                text="<# Eval("cellOnOff") %>"
                onclientclick="changeStatus(this, '<# Eval("cellOnOff") %>');" />
    <asp:hidden id="hfId"
                value="<# Eval("cellId") %>" />
    

    and then

    var g_elem = '';
    
    function changeStatus(elem, type) {
    
        g_elem = elem;
    
        // let's say we are changing
        $(elem).val("changing...");
    
        // let's get the id
        var id = $(elem).prent().find("#hfId").val();
    
        // let's send info to our page to precess and wait for an answer
        $.get('ajax/changeStatus.ashx', 
              { changeFrom: type, id: id },
              function(data) {
                  // got the answer, let's show it
                  $(g_elem).val(data);
              }
        );
    }
    

    and your handler just get’s the id and the changeFrom from the query string and sends back the new value ON or OFF…

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

Sidebar

Related Questions

I have a GridView with 10 columns. On a certain condition, I want to
I have a GridView A that have many columns, one of those contains price
I have a gridview with couple of columns,I want to achieve the following: If
I have a gridview with certain number of columns and the ID column where
I currently have a gridview that has an asp:ButtonField as one of the columns.
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a gridview with the onRowDeleting method implemented. I would like to prompt
I have a gridview and I would like to be able to programatically change
I have a gridview control and I would like the field Title to be
How would I get the value from a GrivView cell when the edit button

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.