RemovingHyperlink

3 replies. Last post: June 30, 2010 9:49 AM by Handy Surya
Tags :

Hi,

I have a web grid which binds to a dataset from the code behing in initialise event. One of the cloumn of the web grid id hyperlink type.

The hyperlink column have some null values in few rows. I am getting the link in all the columns including the cells having NULL values in the dataset.

How to remove the link from the cell of the hyperlink column which has NULL values?

As I am new to web grid please let me know the stepd for getting it achieved.

 

Thanks,

Puru

 

Answers

Sure.

e.g 

if(e.Row.Cells[0].Value == "Null")
{
      e.Row.Cells[0].Value = " ";
}

Regards,
Handy

All Replies

Hello Puru,

When a cell is empty, it should be not rendering hyperlink. E.g in my sample, you can see that there is no hyperlink.

Maybe your values show 'null' text. However, you can overwrite the text into " " at IntializeRow server side event.

Regards,
Handy

Hi Handy,

Thanks for your quick response. Could you please send me the code snippet of the initializeRow event, so that I will get an idea how to do it.

 

Thanks,

Puru

Sure.

e.g 

if(e.Row.Cells[0].Value == "Null")
{
      e.Row.Cells[0].Value = " ";
}

Regards,
Handy

All times are GMT -5. The time now is 3:30 PM.
Previous Next