GridView
-
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
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
-
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
Try this int index = Convert.ToInt32(e.CommandArgument); string pname = GridView1.Rows[index].Cells[0].Text;
-
Try this int index = Convert.ToInt32(e.CommandArgument); string pname = GridView1.Rows[index].Cells[0].Text;
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