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
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. "pelegk1" wrote: > 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 >