Enable/Disable HyperLinkField

P

pargat.singh

I am using <asp:HyperLinkField in gridview as below which is working
fine.

<asp:HyperLinkField HeaderText="Process"
Target="_blank" DataTextFormatString="Process me"
DataTextField="doc_name" DataNavigateUrlFields="doc_name"
DataNavigateUrlFormatString ="~/aaaa.aspx?path={0}" />

Currently it is displaying "Process Me" for all row and opening new
window.But i have some records which are already processed and for
those record i want to display Processed and i don't want to open the
new window.

Can anyone please show me how can i do that?

Thanks in advance.

Pargat
 
G

Guest

Hello.

On the item databound event of the grid, you will need to see if the item
has been processed, if it has you would do

e.Item.FindControl("[HyperLinkField id"]").Text = "processed";
e.Item.FindControl("[HyperLinkField id"]").Enabled = False;

Hope that Helps,

Jon
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top