GridView and canceling a link

G

Guest

i have a GridView with a column :
<asp:HyperLinkField HeaderText="Package Id" DataTextField="id"
DataNavigateUrlFields="id"
DataNavigateUrlFormatString ="Packages.aspx?id={0}"
SortExpression="id"
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:HyperLinkField>


how can i in the packageGridView_RowDataBound event
if i have a certin value, to cancel the link and top ut just some text?

Thanks i nadvance
peleg
 
G

Guest

Hi,
Try to accessing GridView.RowDataBound Event.You can try something like
this in rowdatabound event:
If(e.Row.Rowtype == DataControlRowType.DataRow)
{
//YOU CAN WRITE here conditional statement depending on values of cells
HyperLink hl = e.Row.Cells[2].Controls[0] as HyperLink;
hl.NavigateURL = "#";
}
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top