How can I Display more than 1 images/icons in a single cell of DataGridView

Jan 24 2007 7:35 AM


Hi
It's Urgent!!!!!!!!!!!!!!!!!!!!!!!!!


I'm facing a lot of trouble Here.
I need to display more than one image in a singlecell of a datagridViewImagecell.
This is the code That displays only 1 image at a time.
How can I Display multiple images ????

Can any One find the solution


Thanks in Advance.



Private
Sub dgvProductDisplay_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvProductDisplay.CellFormatting

Dim _cell As DataGridViewCell = New DataGridViewImageCell

If e.ColumnIndex = 0 Then

dgvProductDisplay.Columns(e.ColumnIndex).ValueType = GetType(System.Boolean)

ElseIf e.ColumnIndex = DG_ColSKU Then

dgvProductDisplay.Columns("Col1").GetType()

ElseIf e.ColumnIndex = DG_ColImage Then

dgvProductDisplay.Columns(e.ColumnIndex).ValueType = GetType(System.Drawing.Bitmap)

_cell.ValueType = GetType(System.Drawing.Bitmap)

Try

Dim imgs() As Byte = CType(e.Value, Byte())

Dim strImgUrl As String

strImgUrl = "C:\Shashi\Projects_Data\Combination1.bmp" Dim img As System.Drawing.Bitmap = New System.Drawing.Bitmap(strImgUrl)

'Dim img1 As System.Drawing.Bitmap = New System.Drawing.Bitmap("images\Right.bmp")

e.Value = img

Dim picturebox1 As New PictureBox

Catch ex As Exception

End Try

ElseIf e.ColumnIndex = DG_ColImageLeadTime Then

dgvProductDisplay.Columns(e.ColumnIndex).ValueType = GetType(System.Drawing.Bitmap)

_cell.ValueType = GetType(System.Drawing.Bitmap)

Try

Dim imgs() As Byte = CType(e.Value, Byte())

Dim strImgUrl As String

strImgUrl = "C:\Project_Data\Right.ico"

'str = s2

Dim img As System.Drawing.Bitmap = New System.Drawing.Bitmap(strImgUrl)

'Dim img1 As System.Drawing.Bitmap = New System.Drawing.Bitmap("images\Right.bmp")

e.Value = img

'e.Value += s2

Dim picturebox1 As New PictureBox

'e.Value = img1

Catch ex As Exception

End Try

' ElseIf e.ColumnIndex = 6 Then

' DataGridView1.Columns(e.ColumnIndex).ValueType = GetType(System.Drawing.StringAlignment)

 

Else

e.Value = Nothing

End If

 

 

End Sub