icons in target datagridview

Ultrawhack

Well-known member
Joined
Jul 5, 2006
Messages
164
Location
Canada
Programming Experience
3-5
I have 3 source datagridviews, DGVSource1, DGVSource2, DGVSource3. Each is filled with items in a particular category.

I have a target datagridview DGVTarget onto which selected items from the above will be dropped.

I'd like DGVTarget's column1 to have distinct icons to show which DGVSource the item came from.

How can I show one icon for each item (row) dropped from DGVSource1, a different icon for items from DGVSource2, DGVSource3. Do I use DataGridViewImageColumn ?

Appreciate any help.
 
Multiple DGVS dragdrop item icons

I would appreciate any help with this.

I have 3 Datagridviews.
DGV1 is a source DGV filled with book titles
DGV2 is a source DGV filled with DVD titles
DGV3 is the target DGV (filled with items chosen from DGV1 & 2)

When a user dragdrops an item from BookTitles DGV1, then show a book icon in DGV3 column1. DGV3 column 2 will be the chosen booktitle.

When a user dragdrops an item from DVDTitles DGV2, then show a CD icon in DGV3 column1. DGV3 column 2 will be the chosen DVDtitle.

Please can someone show me how to set up DGV3's column 1 for images and I need help with the dragdrop too.

Thanks in advance
 
Yes, to show an image in DataGridView use the dgvImageColumn. To manage where drop came from either use a class level variable or put the needed information in the drop package itself.
 
I've figured out how to assign an image to an imagecolumn.

Still haven't got the dragdrop part. If copying from DGV2 then show image 02.gif

Would appreciate any help.

VB.NET:
        Dim intPos As Integer
        intPos = Me.DataGridView1.Rows.Add()
        Me.DataGridView1.Item(0, intPos).Value = Image.FromFile("C:\tempfiles\02.gif")
        Me.DataGridView1.Item(1, intPos).Value = "This is a test"
 
Back
Top