473,387 Members | 1,621 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,387 software developers and data experts.

Show image in DataGrid cell

Tim
Hi Guys,

Does anyone know how to show an image in a datagrid cell. I want to display
a 16 x 16 bitmap that can be clicked on to open another form for data
editing.

Can someone help, please???

Tim
Nov 17 '05 #1
2 9910
Tim,

You will need to create a custom column that derives from the
DataGridColumnStyle class. You would use this to display your image.

This assumes you are using a windows forms data grid.

When you create it, you can render the image yourself (it shouldn't be
too hard). You can just load the image up from the byte array in the column
(the column type should be a byte array, at least) and then draw the image
in the space.

Hope this helps.

"Tim" <ti*@home.com> wrote in message
news:ih*******************@news20.bellglobal.com.. .
Hi Guys,

Does anyone know how to show an image in a datagrid cell. I want to
display a 16 x 16 bitmap that can be clicked on to open another form for
data editing.

Can someone help, please???

Tim

Nov 17 '05 #2
Tim
I appreciate that Nicholas, do you have any sample code? Not sure how to
begin...

Tim

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2******************@tk2msftngp13.phx.gbl...
Tim,

You will need to create a custom column that derives from the
DataGridColumnStyle class. You would use this to display your image.

This assumes you are using a windows forms data grid.

When you create it, you can render the image yourself (it shouldn't be
too hard). You can just load the image up from the byte array in the
column (the column type should be a byte array, at least) and then draw
the image in the space.

Hope this helps.

"Tim" <ti*@home.com> wrote in message
news:ih*******************@news20.bellglobal.com.. .
Hi Guys,

Does anyone know how to show an image in a datagrid cell. I want to
display a 16 x 16 bitmap that can be clicked on to open another form for
data editing.

Can someone help, please???

Tim


Nov 17 '05 #3

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

Similar topics

21
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do...
2
by: Frederik | last post by:
Hi all, Situation: Windows Forms, DataGrid, CSharp, WinXP Pro, VS 2003 How can I add a click event to an Image? The Imageis in a DataGrid, drawn with the 'DrawImage' mehtod. The Image does...
2
by: J Sahoo | last post by:
Hi, I have a browse page where I am showing few fields from my SQL Server table. One of the field is Image type, all the fields are bound to a single table. I want to show the image from the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.