Adding Image to Template Column

Discussion in 'ASP .Net' started by Sparky Arbuckle, Mar 9, 2005.

  1. Does anyone know of a way to add an image into a DataGrid's Template
    Column? Any suggestions are greatly appreciated.
    Sparky Arbuckle, Mar 9, 2005
    #1
    1. Advertising

  2. <asp:TemplateColumn HeaderText="Sample">
    <ItemTemplate>
    <asp:HyperLink id="Sample" runat="server" text="Listen"
    NavigateURL='<%# Container.DataItem("SampleURL") %>' />
    </ItemTemplate>
    </asp:TemplateColumn>

    I would like the image right next to the "Sample" HeaderText so that
    the Header looks like:

    Sample [image]

    The image is a music note that is not in the database.
    Sparky Arbuckle, Mar 9, 2005
    #2
    1. Advertising

  3. So is this not possible?
    Sparky Arbuckle, Mar 11, 2005
    #3
  4. Sparky i also asked a similar Question:)



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Mar 11, 2005
    #4
  5. Sparky Arbuckle

    Matt Berther Guest

    Hello Sparky,

    Can you do this?

    <asp:Hyperlink allOfYourExistingAttributes><asp:Image id="myImage" runat="server"
    ImageUrl="~/path/to/the/image"></asp:Hyperlink>

    --
    Matt Berther
    http://www.mattberther.com

    > <asp:TemplateColumn HeaderText="Sample">
    > <ItemTemplate>
    > <asp:HyperLink id="Sample" runat="server" text="Listen"
    > NavigateURL='<%# Container.DataItem("SampleURL") %>' />
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > I would like the image right next to the "Sample" HeaderText so that
    > the Header looks like:
    >
    > Sample [image]
    >
    > The image is a music note that is not in the database.
    >
    Matt Berther, Mar 12, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dexter
    Replies:
    1
    Views:
    403
    Eliyahu Goldin
    Jan 18, 2005
  2. Ken Varn
    Replies:
    1
    Views:
    956
    Ken Varn
    Aug 19, 2005
  3. Charleees
    Replies:
    2
    Views:
    8,175
    Eliyahu Goldin
    Jun 20, 2006
  4. Ravichandran Mahalingam

    Bound Column or Template Column (w dAdapater?) in DataGrid

    Ravichandran Mahalingam, Jan 9, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    201
    Ravichandran Mahalingam
    Jan 9, 2004
  5. Esperanza

    Template column base on another column value

    Esperanza, Feb 18, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    5
    Views:
    161
    Elton Wang
    Feb 21, 2005
Loading...

Share This Page