473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to get image in header of Gridview

I want an image and text in the column header in my GridView. Does anyone
know how to do that? Thanks.
Apr 17 '06 #1
4 3895
add img tags to your column header text
"lanem" <la***@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
I want an image and text in the column header in my GridView. Does anyone
know how to do that? Thanks.

Apr 17 '06 #2
That doesn't work. You can't put HTML code in there.

"Vaibhav" wrote:
add img tags to your column header text
"lanem" <la***@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
I want an image and text in the column header in my GridView. Does anyone
know how to do that? Thanks.


Apr 17 '06 #3
I think , I did something like that.
Another way you can do it, from the code behind
System.Web.UI.WebControls.Image imgControl=new
System.Web.UI.WebControls.Image();
imgControl.ImageUrl="images/xyz.gif";
if(e.Item.ItemType==ListItemType.Header)
{
e.Item.Cells[0].Controls.Add(imgControl);
}

"lanem" <la***@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
That doesn't work. You can't put HTML code in there.

"Vaibhav" wrote:
add img tags to your column header text
"lanem" <la***@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
I want an image and text in the column header in my GridView. Does anyone know how to do that? Thanks.


Apr 18 '06 #4
Thanks. I'll give that a try.

"Vaibhav" wrote:
I think , I did something like that.
Another way you can do it, from the code behind
System.Web.UI.WebControls.Image imgControl=new
System.Web.UI.WebControls.Image();
imgControl.ImageUrl="images/xyz.gif";
if(e.Item.ItemType==ListItemType.Header)
{
e.Item.Cells[0].Controls.Add(imgControl);
}

"lanem" <la***@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
That doesn't work. You can't put HTML code in there.

"Vaibhav" wrote:
add img tags to your column header text
"lanem" <la***@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
> I want an image and text in the column header in my GridView. Does anyone > know how to do that? Thanks.


Apr 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Auto | last post by:
Hello, I would like to know how do display an image into a Gridview (ASP.NET 2.0) taken directly from a DataBase, NOT using an URL, like described in this article: ...
0
by: waldy | last post by:
I was able to implement sorting in a gridview. However, I would like to let users know their sort direction (i.e. arrow down -- asc, arrow up -- desc) during sorting. How do I insert an image to...
1
by: Smokey Grindle | last post by:
does anyone know of a good example of asp.net 2.0's gridview showing a sort order arrow in the column header correctly and working? I cant seem to get what ive found on google to work (see previous...
2
by: manmit.walia | last post by:
Hello Fellow Developers, I have a small problem that you might be able to help me with. The method that I am trying to create is the ability to export a GridView and a image to word or excel. I...
1
by: staeri | last post by:
I want to display a background image in the header of my GridView but when I do that by setting HeaderImageUrl="..." the HeaderText isn't visible. It seems to me that either I can show the...
2
by: Dale | last post by:
This seems like it should be simple and I am pretty sure I've done similar things a hundred times before but I sure can't seem to get it right this time. I have a GridView with a column of text...
4
by: tirath | last post by:
hi, I want to display data in on my web page, in gridview in this format: Group A Group B A1 A2 B1 B2 Test 1 1 2 1 2 Test 2 1 2 1 2 Group A is header to columns A1 and A2...
5
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I have a sub in vb.net that adds extra headers to a gridview and it works very well. however, i tried to translate it to c# and i'm getting the header inserting itself over the first datarows and...
7
by: rote | last post by:
I would like to make my Gridview header dynmic i.e databinded from database.. I want my users to be able to change the headers on the fly.. Any ideas?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.