How to displaymultipleimages/icons in a singlecell
Hi friends
It's urgent..
I'm facing problem for displaying multiple images in a single cell
Of a datagridview.
A single image can be displayed like..
Private Sub dgvProductDisplay_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEve ntArgs) 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("SKU").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\Combination1.bmp" 'dtProduct.Rows(e.RowIndex).Item("C:\Images\Right. bmp")
'strImgUrl = "C:\Shashi\Projects\Images\Right.bmp"
'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 = 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:\Shashi\Projects\OneStop3.ico" 'dtProduct.Rows(e.RowIndex).Item("C:\\Images\Right .bmp")
strImgUrl = "C:\E Drive\HP Projects\One Stop\SourceCode\FrontEnd\ONESTOPUI\OneStop\Images\ OneStop3.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
This is for a single picture display...
How can I display multiple images..
Please mail me it's urgent...
Shashikanta,
B.Tech(CSE)
College Of Engg.& Tech.,
Bhubaneswar.
|