DataGridItemEventArgs and Hyperlinkcolumn

G

Guest

I have a dataset (ds) and a Hyperlinkcolumn as the first column.

I want to extract the text of the displayed hyperlink (DataTextField) within
the DataGridItemEventArgs object.

So I try the trusty e.Item.Cells(0).Text. It is blank for a hyperlink column.

I also tried something like e.Item.Cells(0).Controls(0).ToString.

Still no go.

What am I missing?
 
P

PeterKellner

I have a dataset (ds) and a Hyperlinkcolumn as the first column.

I want to extract the text of the displayed hyperlink (DataTextField) within
the DataGridItemEventArgs object.

So I try the trusty e.Item.Cells(0).Text. It is blank for a hyperlink column.

I also tried something like e.Item.Cells(0).Controls(0).ToString.

Still no go.

What am I missing?

not such a simple problem. Fritz Onion has a good example of how to
solve this.

GridViewRow row =
(GridViewRow)((Control)e.CommandSource).Parent.Parent;

http://pluralsight.com/blogs/fritz/archive/2005/06/24/11975.aspx
Peter Kellner
http://peterkellner.net
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top