Results 1 to 2 of 2

Thread: Picture in DataGrid (ASP.NET)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Thailand
    Posts
    221

    Picture in DataGrid (ASP.NET)

    How can we show picture in datagrid?

    Thank you,
    Teeravee Sirinapasawasdee
    Gestalt IT Consulting Group
    Growth Your Business With e-Process

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    You could just store the name of the image in the database, like this (image1.jpg), then in your datagrid you can just do something like this
    VB Code:
    1. <asp:TemplateColumn HeaderText="HeaderText">
    2.    <ItemTemplate>
    3.       <img src='\images\<%# Databinder.Eval(Container.DataItem,"DatabaseFieldName")%>'>
    4.    </ItemTemplate>
    5. </asp:TemplateColumn>
    Once you filled in the field name, it would look like this when the page is displayed.
    "images\image1.jpg"
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width