In UltraWingrid, i want to perform grouping by a column that contains images. For more details, please look into the file attached (GroupingByImageColumns.rar). I am using Infragistics version 8.1 (with service release - NetAdvantage_20081_CLR2X_WIN_SR_2161).
The DotNet Image class is not IComparable. So the grid cannot automatically group by images - it has no way to know that one image is the same as another image.
If you can tell from the image, or from some other data in the row, that the images are the same, then you could acheive what you want by writing your own IGroupByComparer class and applying it to the GroupByComparer property of the column. This allow you to tell the grid which images are the same.
You will probably need to write a SortComparer for the column, too, so that the rows are sorted properly by image.
The image column is of type "System.Drawing.Bitmap". On grouping by image column, i need two groups like, one grouped rows, with images in image column and the other grouped rows, without images in the image column.
As i have mentioned in the document, the image is added to the column, based on a Boolean column. Say, if boolean column's value is "True", the corresponding image column will have a image, otherwise, for "False", the image column will be empty or null. (Note: Image column will be visible in the grid and Boolean column is a hidden column).
Can you give me a sample code of how to group the image column by itself or based on the Boolean column?
Hi,
Okay... if the images are based on the value in another column, then essentially what you want to do is.. when the image column is grouped, you really want to group based on the boolean column. This should be very easy to acheive. You simply write an IGroupByEvaluator and handle any methods of the interface by looking at the boolean column instead of the image column.
This assumes, of course, that all of the "True" cells are using the same image.
Mike,
Thanks. I have created a class that implements IGroupByEvaluator. It really works good.