Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2007, 08:37 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default Doubts on DataGrid Hyperlink Column

I'm into an asp.net application with C# as code behind.
   I have used DataGrid control to display a set of records as below:
  (Data populated from SQL Server SP & is bounded with DataGrid)
  The code goes like this:

<asp:DataGrid ID="dgRep" runat="server" AutoGenerateColumns="False" Width="100%" OnItemDataBound="dgRep_ItemDataBound">
    <AlternatingItemStyle CssClass="alt_items" />
    <ItemStyle CssClass="items" />

    Ã‚  <Columns>
        <asp:HyperLinkColumn DataTextField="name"Â Â DataNavigateUrlField=" name" DataNavigateUrlFormatString="~/Admin/Summary01.aspx?na={0}">
<ItemStyle HorizontalAlign="Left" />
        </asp:HyperLinkColumn>
        Ã‚  <asp:BoundColumn DataField="amount" DataFormatString="{0:C}">
<ItemStyle HorizontalAlign="Right" />
        </asp:BoundColumn>
        Ã‚  .....
    </Columns>
    <FooterStyle Font-Bold="False" />
</asp:DataGrid>


******************************************
name amount Perc count
******************************************
[u]ABC</u> 1000 11.4 15
[u]XYZ</u> 2000 22.8 20
[u]L&T</u> 500 5.7 7
[u]Others</u> 35500 45.7 147


    Here i need two things:Â Â
        1.  On the first column, I dont need hyperlink on the name field of last row - "Others".  Â
            - how to remove link only for that value? need to do some coding on code behind file. if so, what?
        2.  when i click hyperlink under name column, the page will be navigated to another page with clicked value as querystring. (ref: na={0})
            Ã‚ Here, if i click a data with "&", (ex. L&T) the querystring value got terminated before "&", so how can i put "Server.URLEncode" on the name column?


Expecting your positive reply.

Thanks in Advance.

Best Regards,
Saran.
__________________
Best Regards,
Saran.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing Datagrid with hyperlink column shs BOOK: Beginning ASP.NET 1.0 0 October 24th, 2004 12:13 AM
Datagrid Button/Hyperlink Column snowydust VB How-To 0 September 6th, 2004 02:14 AM
Hyperlink column in datagrid not working ltdanp21 General .NET 1 July 13th, 2004 03:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.