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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:01:33+00:00 2026-05-16T04:01:33+00:00

Using C# & Mysql In my webpage am using gridview, if i click the

  • 0

Using C# & Mysql

In my webpage am using gridview, if i click the column in the girdview the value should display in the textbox.

For Example

Griview

Column1 column2 Column3

    1 Raja 9876
    2 Ravi 7890
    3 Ramu 9879
    ...

If i click the 2 rows all the values should display in the textbox

Textbox1.text = 2
textbox2.text = Ravi
textbox3.text = 9879
...,

How to write a code for this condition.

Need C# code 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-16T04:01:34+00:00Added an answer on May 16, 2026 at 4:01 am

    I’m assuming that by stating “[…]click the 2 rows[…]” you actually mean “click the 2nd row“; at least, this is what your last snippet suggests, since it shows only the values of the 2nd row (on a little side note: the ID’s wrong there; it should be 7890).

    The following code snippet shows a GridView which allows the selection of a single row, and uses an event handler in the code-behind to set the text of each TextBox to the according value in the selected row:

    Page.aspx:

    <asp:GridView runat="server" ID="gridView" OnSelectedIndexChanged="gridview_SelectedIndexChanged" AutoGenerateSelectButton="true"></asp:GridView>
    

    Event handler in the code-behind file Page.aspx.cs:

    void gridview_SelectedIndexChanged(object sender, EventArgs e)
    {
        var grid = sender as GridView;
        if (grid == null) return;
    
        //Cell[0] will be the cell with the select button; we don't need that one
        Textbox1.Text = grid.SelectedRow.Cell[1].Text /* 2 */;
        Textbox2.Text = grid.SelectedRow.Cell[2].Text /* Ravi */;
        Textbox3.Text = grid.SelectedRow.Cell[3].Text /* 7890 */;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# & MYSQL Using Combobox in my webpage, in a combobox i want
Using C# & Mysql I have combobox & button in my webpage, if i
Using C# & Mysql When i get the input date in the textbox it
I'm using PHP & MySQL to go into a database and change the value
I have been tasked to develop an interactive website using java & mysql: using
I believe I am using the correct queryString params for jdbc connection jdbc:mysql://localhost:3306/databasename?useUnicode=true&characterEncoding=utf8&noAccessToProcedureBodies=true My
I am fetching the current date & time using NOW() in mysql. I want
I am new to use session management & I am using struts with MySQL
Using MySQL & Java Script I want to make a mysql connection in Java
Using MySQL & SQL Server ID sDate 001 03/06/2010 002 07/08/2010 .... .... sDate

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.