Solved

Gridview custom column

Posted on 2007-11-29
3
332 Views
Last Modified: 2012-08-14
In asp.net I am creating a gridview. All columns are from a table, except one. In this one column, it has a header and the column value is the same for every row. It is an image. The same image. On every row. Yep every row.

So how do I create a column that I can just put in the same image for every row?

I tried a TemplateField but the way I did it, it wouldn't let me add an <img tag or a or an <asp:Image runat="server"></asp:Image>.

I tried an ImageField from the properties, but that seemed to want to pull it from the database? <asp:ImageField

How do I do this?

thanks!
0
Comment
Question by:Starr Duskk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
bele04 earned 500 total points
ID: 20373984
A templatefield should do the trick, it would look something like this
<asp:GridView ID="GridView1" runat="server">
            <Columns>
                <asp:TemplateField HeaderText="78">
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" ImageUrl="your image link here" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20373985
>>it wouldn't let me add an <img tag or a or an <asp:Image
runat="server"></asp:Image>

Why not?

Bob
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 20374338
Hmmm. I guess it does. <grin>

I got squiggly lined for something earlier.

thanks!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question