Link to home
Start Free TrialLog in
Avatar of choubeyb
choubeyb

asked on

Image in Datagridview

How i add images in data gridview at runtime.

i am trying as below

but not getting correct output

 Plz help me
Dim x As Integer
        Dim imageColumn As System.Windows.Forms.DataGridViewImageColumn
        Dim columnCount As Integer = 0
        Do
            
            imageColumn = New System.Windows.Forms.DataGridViewImageColumn
            i = 0
            
            imageColumn.Image = ImageList1.Images.Item(i)
 
            imageColumn.ImageLayout = DataGridViewImageCellLayout.Stretch
            imageColumn.Description = "default image layout"
            DataGridView1.Columns.Add(imageColumn)
            columnCount = columnCount + 1
            i = i + 1
        Loop While columnCount < 3
        DataGridView1.Refresh()

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of vb_jonas
vb_jonas
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin