DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 11 Aug 2007 16:00:00 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    pelegk1
          2    Manish Bafna


GridView and canceling a link   
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
Date:Sat, 11 Aug 2007 16:00:00 -0700   Author:  

RE: GridView and canceling a link   
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
> 
Date:Sun, 12 Aug 2007 21:20:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us