Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2007, 08:37 AM
Authorized User
Join Date: May 2004
Location: Chennai, Tamil Nadu, India.
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:BoundColumn DataField="amount" DataFormatString="{0:C}">
<ItemStyle HorizontalAlign="Right" />
        Â Â .....
    <FooterStyle Font-Bold="False" />

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,
Best Regards,
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 12:15 PM.

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