datagridviewColumn reference .png or .ico - cellformating.

0
0

I was trying change a image of cells in a column, but I only can use the theme reference, how i do to import a image:

Inside the Cellformating method:

if (e.ColumnIndex == 1)
{
if (e.Value.Equals(1))
{
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
e.CellStyle.BackgroundImageSource = “icon-folder”; // this part, i want use other reference.
}
else
{
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
e.CellStyle.BackgroundImageSource = “icon-folder-open”;
}
}

  • You must to post comments
0
0

but in this case, can i import the png image inside my project, and reference the path directly?

  • You must to post comments
0
0

Hi Jay

.ico is not supported. ImageSource can be the name of an image in the theme or the relative path to an image resource or a url. just like any image loaded by a browser.
HTH
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.