Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2007, 09:04 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Shashikanta
Default 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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabled icons EricJ VB How-To 0 July 12th, 2005 09:51 AM
Icons in Menu ashu_from_india Pro VB 6 2 June 3rd, 2005 10:58 PM
Menu Icons snowy0 VB.NET 2002/2003 Basics 2 September 28th, 2004 08:09 PM
Using icons within a userform Stubby Excel VBA 2 July 7th, 2004 08:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.