I Want add images to my dataGridView columns, but i cant find the way to reference my image, or .ico inside of my project.
how i do this reference to inside the project, the path. I want generate my dll with my images.
Example:
private void createGraphicsColumn()
{
Icon treeIcon = new Icon(this.GetType(), “????????”); // this dude
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
iconColumn.Image = treeIcon.ToBitmap();
iconColumn.Name = “Tree”;
iconColumn.HeaderText = “Nice tree”;
dataGridView1.Columns.Insert(2, iconColumn);
}
Hi Jay,
The right thing to do is to have your Images resources accessible throughout the app.
That way it could be accessible from anywhere, something similar to MyApp.Properties.Resources.myimage.
With Wisej.NET, there’s another way of loading images and that’s directly from the ImageSource property which would behave similarly to a website loading a ‘static image’ from the public folder, or using a URL.
You can find out more about the latter in our Documentation.
So, you have a few options:
I would also highly encourage that you check out our DemoBrowser Application, it’s Open Source and you can use it to see how any control can be used/configured and much more!
HTH,
Alaa
Please login first to submit.