I have problem in gridview Cell value

Posted by Nuwan under ASP.NET on 4/23/2012 | Points: 10 | Views : 1123 | Status : [Member] | Replies : 1
Dear All,

I have bind in grid view using Sql Data Source, It have three main field.
SlipNo,Amount, Date. no i want to get a SlipNo in gridview if i select command field in gridview.
How i do that?
Please help me..........



Posted by: Rajkatie on: 4/23/2012 [Member] [MVP] Gold | Points: 25

you have to implement SelectedIndexChanging event.

protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
string slipNo = GridView1.Rows[e.NewSelectedIndex].Cells[1].Text;

Rajesh Patel
.Net Trainer(MSCD | MCT | MS)
Brainbench (Asp.Net 4.5 and C# 5.0)

Nuwan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response