yuvaratna
asked on
Adding Image To Data Grid View Using Image List
I want to add an image to the 6th column of the datagrid view..i tried the followinhg snippet..But i dont wanted to Give the path of the computer ..i know that we can ad an im age using image list ...how can i do that!
Dim dgImage As New DataGridViewImageColumn
dgImage.HeaderText = "Delete"
dgImage.Image = Drawing.Image.FromFile("C:\....\....\....\delete.gif")
dgImage.ImageLayout = DataGridViewImageCellLayout.Normal
TravelGridview.Columns.Insert(5, dgImage)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Configure the imagelist, add image you want..
Then to retrieve the image in the image list do the following
imagelist1.image(0) '<--- This will load the first image in the imagelist...