I created an unbound column and I want the cells in that column to be an button with an icon in it, Below is the code that I have but I can't seem to get the icon to appear. This is all being accomplished in the InitializeLayout.
What am I missing?
// Add a new column...
editButton.CellButtonAppearance.Image = "~/Resources/Plus.ico";
// Make this column a button...
e.Layout.Bands[0].Columns[EDIT_USER].ButtonDisplayStyle = ButtonDisplayStyle.OnCellActivate;
e.Layout.Bands[0].Columns[EDIT_USER].CellButtonAppearance.Image = "~/Resources/Plus.ico";
Set the Image property to an actual Image. :)
If you know the file name of the image, you could use Image.FromFile();
What wouldbe the best way to accomplish this then?
It looks like you are setting the Image property to a string. It does not take a string, it takes either an Image (like a Bitmap) or an index into the grid's ImageList (if one is assigned).
By passing in a string, the grid is probably assuming you are referring to the Key of an image in the grid's ImageList and you probably have not assigned an ImageList.