Posted 21 February 2018, 9:31 am EST
Good morning, I’m using Flexgrid control in WinForms.
I would like to show an image bounbed to cell value.
Cell data type is bool, I have 2 images: une for when the value is true one when it’s false.
Could you explain how to perform such a task?
Actually my solution is not working and is listed as below:
cs = c1FlexGrid1.Styles.Add("Verified");
cs.DataType = typeof(bool);
cs.Display = DisplayEnum.ImageOnly;
cs.ImageAlign = ImageAlignEnum.CenterCenter;
cs.ImageMap = ht;
This is my hashtable for bound data and images:
Hashtable ht = new Hashtable();
Bitmap CheckedAlarm = (Bitmap)Image.FromFile("WhenFalse.png");
Bitmap UncheckedAlarm = (Bitmap)Image.FromFile("WhenTrue.png");
ht.Add(false, CheckedAlarm);
ht.Add(true, UncheckedAlarm);
Actually it doesnt seems to work as I would because the grid continue to show a checkbox.
Thankyou for your hints.
Regards