Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to add image to the image column of datagridview, using the following code but it returns an error (system.argumentexception: Parameter is not valid)

VB
ofdLogoImage.ShowDialog()
vrPicHolder = IO.File.ReadAllBytes(ofdLogoImage.FileName)
dgvLogo.Item(3, dgvLogo.Rows.Count - 1).Value = vrPicHolder


Please advise.
Thanks!
Posted
Comments
Kschuler 15-Dec-14 11:25am    
Are you sure that there are at least 4 rows in the grid? Or wait...I mean 4 Columns...Looks like the syntax is DataGridView.Item(columnIndex, rowIndex)
http://msdn.microsoft.com/en-us/library/ms158656(v=vs.110).aspx

1 solution

Make sure "ofdLogoImage.FileName" refers to a correct and full path of an image. Invalid path or filename reproduces the above error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900