Datagrid - HyperLinkColumn

R

Rob Meade

Hi all,

I have just added a hyperlink column to my datagrid - however I am having
some troubles getting it to behave as I would like...

My objective is to have a hyperlink that I can click on - it doesn't take
the page anywhere (ie, javascript:void(0);) - but I want an onClick event
for it.

I can normally do this kinda thing with a 'Attributes' property of the
object - however the HyperLinkColumn doesn't appear to have one of these.

Can anyone advise me how I can achieve this please.

The end game is to have one of the columns that has a value from the
database become the hyperlink - however - for now I've just added a 3rd
column which has the word "Select" etc..

Code as follows:

' Create new instances of our bound column objects
dgCol3 = New HyperLinkColumn

dgCol3.Text = "Select"
dgCol3.NavigateUrl = "javascript:void(0)"
dgCol3.HeaderText = ""
dgCol3.HeaderStyle.CssClass = "normalText"
dgCol3.HeaderStyle.Font.Bold = True

Any information would be appreciated - please note that other than the
server control for the datagrid - all of the columns are being added
programmatically rather than embedded into the HTML.

Thanks

Rob
 

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,812
Latest member
GracielaWa

Latest Threads

Top