CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    17

    image in datagrid asp.NET

    how can i add an image into datagrid asp.NET ?

  2. #2
    Join Date
    Feb 2006
    Posts
    11

    Re: image in datagrid asp.NET

    you could use this to add an image to your dg, value in db as pic.png or pic.jpg
    Code:
    <asp:TemplateColumn HeaderStyle-Width="125" HeaderText="text">
       <ItemTemplate>
       <asp:Image Width="150" Height="150" ImageUrl='<%#("http:\\localhost\yourmap\Images\"+DataBinder.Eval(Container.DataItem, "datafield")) %>' runat="server" ID="Image1" /> 
       </ItemTemplate>
    </asp:TemplateColumn>

  3. #3
    Join Date
    Nov 2004
    Location
    LA. California Raiders #1 AKA: Gangsta Yoda™
    Posts
    616

    Re: image in datagrid asp.NET

    Or in a tables header cell.
    Code:
    <asp:TableCell Text="&lt;img src=&quot;../images/calendar.gif&quot;&gt;></asp:TableCell>
    VB/Office Guru™ (AKA: Gangsta Yoda™)
    VB Forums - Super Moderator 2001-Present

    Microsoft MVP 2006-2011

    Please use [code]your code goes in here[/code] tags when posting code.

    Senior Software Engineer MCP, BSEE, CET
    VS 2012 Premium, VS 6.0 Enterprise SP6, VSTO, Office Ultimate 2010, Windows 7 Ultimate
    Star Wars Gangsta Rap SE Reputations & Rating Posts Office Primary Interop AssembliesAdvanced VB/Office Guru™ Word SpellChecker™.NETAdvanced VB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address ListVB6/Crystal Report Ex.VB6/CR Print Setup Dialog Ex.

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

Featured