Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. onclick event in data grid

onclick event in data grid

Scheduled Pinned Locked Moved ASP.NET
csharpcssasp-netlearning
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ps srinivasan
    wrote on last edited by
    #1

    Hello frnd I displayed my mark list table in data grid.if i click the roll number cell i want to display the corresponding value (like name ,class) in text box,i am using asp.net 1.1.i am MCA student,beginner in asp.net,so please any one give some code or link or idea plz urgent this.

    I N N 3 Replies Last reply
    0
    • P ps srinivasan

      Hello frnd I displayed my mark list table in data grid.if i click the roll number cell i want to display the corresponding value (like name ,class) in text box,i am using asp.net 1.1.i am MCA student,beginner in asp.net,so please any one give some code or link or idea plz urgent this.

      I Offline
      I Offline
      InsDev
      wrote on last edited by
      #2

      use grid rowevent to get the value of that cell and display your desire result. Devjit Das.

      1 Reply Last reply
      0
      • P ps srinivasan

        Hello frnd I displayed my mark list table in data grid.if i click the roll number cell i want to display the corresponding value (like name ,class) in text box,i am using asp.net 1.1.i am MCA student,beginner in asp.net,so please any one give some code or link or idea plz urgent this.

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        Put a button column in your DataGrid and write code in Itemcommand of DataGrid. Use the parameter e in that event to find the cell value and assign it to textbox.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        1 Reply Last reply
        0
        • P ps srinivasan

          Hello frnd I displayed my mark list table in data grid.if i click the roll number cell i want to display the corresponding value (like name ,class) in text box,i am using asp.net 1.1.i am MCA student,beginner in asp.net,so please any one give some code or link or idea plz urgent this.

          N Offline
          N Offline
          Naik A2Ze
          wrote on last edited by
          #4

          hello.... this code 4 dispalying.. SqlConnection sqlConnection = new SqlConnection("server=....;User Id=sa; Password=...;Initial Catalog=....."); SqlDataAdapter sqlDataAdapter = new SqlDataAdapter("select * from emp", sqlConnection); DataSet dataSet = new DataSet(); sqlDataAdapter.Fill(dataSet); GridView1.DataSource = dataSet; GridView1.DataBind(); and u can dispaly in the text box 4 perticular nuber...details... u can wrote with in clivk event......... int id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value); GridViewRow r = GridView1.Rows[e.RowIndex]; TextBox t1, t2; t1 = (TextBox)r.FindControl("TextBox1"); t2 = (TextBox)r.FindControl("TextBox2"); SqlConnection sqlConnection = new SqlConnection("server=....;User Id=sa; Password=...;Initial Catalog=....."); sqlConnection.Open(); cmd.ExecuteNonQuery(); sqlConnection.Close(); GridView1.EditIndex = -1; Bind();

          Naik M

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups