Hello,
I have a grid with a self-referencing hierarchy.Technically this is working well, but I want to set the following individual styles:
1) because the columns are the same between the bands, I do not want to repeat the column-headers on the sub-band.2) The first column is gouped with cell-merging. Because of this, there is a grey separator on the right side of the grouped column. How can I remove this line?3) I want a separate cell style on the nested level. How can I modify the style of these cells separate to the cells on the first level? Hint: I have re-templated the ig:CellControl, the solution for the sub-band cells have to be compatible with the retemplating
For clarification I've attached a screenshot displaying my wishes.
Thanks and best regards,Josef.
Hello Josef,
Thank you for your reply. I am very glad that my sample applications was helpful for you. Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello Krasimir,
thank you again for this great help.I've learned a lot and my grid looks very nice now :-)
Josef.
ps: no, not really with a yellow background...
Thank you for your post. I have been looking into the functionality that you have described and since the XamGrid does not expose publically information that can be used in order to implement it, I can suggest creating a class that derives from the XamGrid. The XamGrid exposes a protected property called MouseOverCell, which can be used to implement notification for the MergedContentControl that a cell is hovered. Also you can use the ActiveCell property in order to notify that a cell is activated and to change the MergedCellControl’s background to the selected. I have added two more bindings to the MultiBinding for the Background property of the MergedCellContol, in order to implement the above described notifications. I am attaching the modified sample application.
Please let me know if you need any further assistance on the matter.
you are awesome :-)Thank you for the sample.
The icing on the cake would be if the complete MergedContentControl would highlight on hovering over one of the rows (or over itself).And if the background of the MCC changes color on selecting one of its merged rows.....
I'll try to figure out how to do this, but I think i'll fail doing so :-/If you have an idea.....
Thank youJosef.
Thank you for your reply and the attached screenshot. Regarding your first question, the trigger is actually working and the cell of the child band are colored it Yellow. The reason for this to not appear is that when you use a ColumnLayout as in the modified sample application, grouping the Contact columns is causing both parent and child bands to be grouped. When you group a column and you have the MergeCells action, the CellControls of the column are not visible and there is a MergedContentControl element, which represents the merged cells, over the CellControls and you are actually seeing the MergedContentControl instead of the CellControl. In order to color the MergedContentControl at the child band, I can suggest creating a style for the MergedContentControl and bind its Background to its data context and the XamGrid and using a IMultiValueConverter, to determine whether the MergedContentControl is from child band and change its background.
Regarding your second question, the behavior that you have described is also caused by the MergeCells action and the MergedContentControl. When you have grouped column and MergeCells, the MergedContentControl is visible and when you hover the MergedContentControl, the cell (CellControl) of the grouped column become visible.What I can suggest in order to avoid this behavior is setting the opacity of the CellControls that belongs to a grouped column to 0. I have modified the sample application that you have attached, in order to demonstrates both of the approaches that I have described.