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. GridView

GridView

Scheduled Pinned Locked Moved ASP.NET
helpquestion
4 Posts 3 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.
  • V Offline
    V Offline
    Vijayitsb
    wrote on last edited by
    #1

    Hi I am using GridView control.I want to get cell value in RowCommand Event. I have tried this code Grv_GridView.Rows[Grv_GridView.SelectedRow].Cells[0].Text But I'm getting Error, How do I get cell value, pls Help me

    Thank & Regards Vijay s

    A S 2 Replies Last reply
    0
    • V Vijayitsb

      Hi I am using GridView control.I want to get cell value in RowCommand Event. I have tried this code Grv_GridView.Rows[Grv_GridView.SelectedRow].Cells[0].Text But I'm getting Error, How do I get cell value, pls Help me

      Thank & Regards Vijay s

      A Offline
      A Offline
      Amit Agarrwal
      wrote on last edited by
      #2

      Hope it helps: protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { ((LinkButton)this.GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Controls[0]).BackColor = Color.Red; }

      Amit Agarwal

      1 Reply Last reply
      0
      • V Vijayitsb

        Hi I am using GridView control.I want to get cell value in RowCommand Event. I have tried this code Grv_GridView.Rows[Grv_GridView.SelectedRow].Cells[0].Text But I'm getting Error, How do I get cell value, pls Help me

        Thank & Regards Vijay s

        S Offline
        S Offline
        Soumini Ramakrishnan
        wrote on last edited by
        #3

        Try this int index = Convert.ToInt32(e.CommandArgument); string pname = GridView1.Rows[index].Cells[0].Text;

        V 1 Reply Last reply
        0
        • S Soumini Ramakrishnan

          Try this int index = Convert.ToInt32(e.CommandArgument); string pname = GridView1.Rows[index].Cells[0].Text;

          V Offline
          V Offline
          Vijayitsb
          wrote on last edited by
          #4

          Yes Its working,After that I am adding Button in Template column.After clicking that button Its invisible I have done that using this code. GridViewRow row = (GridViewRow)(((Button)e.CommandSource).NamingContainer); Button lblProdId = (Button)row.FindControl("btn"); lblProdId.Visible = false; but now This code getting Error. int index = Convert.ToInt32(e.CommandArgument); string pname = GridView1.Rows[index].Cells[0].Text; what i can do, Do u have any Idea

          Thank & Regards Vijay s

          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