Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 04-06-2009
Member
 
Join Date: Mar 2009
Posts: 37
asp.net adding databound hyperlink columns to gridview programmatically

I indicated a GridView, around data in a table. The columns are bound. How did I become a certain column value an hyperlink? There is a possibility, instead of asp: BoundField, I could asp: I would populate hyperlink, but as?
Reply With Quote
  #2  
Old 04-06-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: asp.net adding databound hyperlink columns to gridview programmatically

Here is the code as follows : Hope its Helpful

Code:
 <asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="White"
            BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" 

GridLines="None" AutoGenerateColumns="False">
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
            <Columns>
                <asp:BoundField DataField="CategoryID" />
                <asp:HyperLinkField DataNavigateUrlFields="CategoryID"

 DataNavigateUrlFormatString="SmallWindow.aspx?id={0}"
                    DataTextField="CategoryName" NavigateUrl="SmallWindow.aspx" />
                <asp:BoundField DataField="Description" />
            </Columns>
        </asp:GridView>
Reply With Quote
  #3  
Old 05-06-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: asp.net adding databound hyperlink columns to gridview programmatically

With regard to the overall style I raccomandilo to use a file. Skin in the "Themes" folder of your ASP.NET 2.0 app. In this file the following Articles of GridView to CSS classes:

Code:
<asp:GridView SkinID="" runat="server" CellPadding="4" GridLines="Both" CssClass="GridView" Width="100%" BorderColor="#ECECEC" BorderStyle="Solid">
    <HeaderStyle CssClass="GridHeader" />
    <FooterStyle CssClass="GridFooter" />
    <SelectedRowStyle CssClass="GridSelectedRow" />
    <AlternatingRowStyle CssClass="GridAlternatingRow" />
    <EditRowStyle CssClass="GridEditRow" />
    <RowStyle CssClass="GridRow" />
    <PagerStyle CssClass="GridPager" />
   <EmptyDataRowStyle CssClass="GridEmptyRow" /> 
</asp:GridView>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "asp.net adding databound hyperlink columns to gridview programmatically"
Thread Thread Starter Forum Replies Last Post
Adding an Attachment to a List Item Programmatically in SharePoint bijayani Software Development 2 30-06-2010 12:06 PM
Resource Usage View - adding columns only available in Task Views Mintoo Microsoft Project 2 09-09-2009 09:40 PM
Programmatically add a database Zool Software Development 2 19-05-2009 09:08 PM
Add Columns to GridView Programmatically Firon Software Development 3 19-05-2009 06:44 PM
Free SMS Server to send SMS programmatically Cavan Networking & Security 3 16-05-2009 08:23 PM


All times are GMT +5.5. The time now is 07:04 AM.