Column Name from DataGrid (C# and ASP.Net)

Joined
Oct 26, 2005
Messages
3
Reaction score
0
Hey.

I want to use the following code in an button click event:

Code:
Session.Add("countryno", grdMain.Items[grdMain.SelectedIndex].Cells[1].Text);

But now i wish to replace the .Cells[1] part with something like this
Code:
.Cells[grdMain.Columns["countryno"]]

Can anyone tell me how to do this mayb?

Thanx in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top