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 email. I have been looking into the appearance that you have described and I have created a sample application for you, that demonstrates how you can achieve it. To remove the grouping delimiter, I have created styles for the FixedBorderCellControl and FixedBorderHeaderCellControl. Also I have created style for the CellsPanel in order to remove the header from the ChildBands and style for the CellControl in order to color the cells in the Kontakt column from the child bands.
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 for this sample.Most of it worked in my project.Unfortunately there are some differences between your sample and my project.
I've attached a modified version of your sample showing these issues.On the next post I'll put a screenshot illustrating them. Somehow I can only attach one file per post....
Here the main differences and what they cause:
1) I do not use autogenerated columns, but a custom ColumnLayout.This is, because I have to put more then text in a column, for what I use TemplateColumns.To get the cell-merge working, I have the following code in the constructor: ContactGrid.GroupBySettings.GroupByColumns.Add(ContactColumn); Using this, the coloring of the first child-cell does not work any more.I've put in code to color the second child-cell, too, and this works.
2) Something is weired with the margins/paddings within the first column.When hovering over the cells, the content "hops" somehow.Sometimes when you hover over a cell and leave it on the left side, two overlapping contents are visible.You can see it on the image.I would like eleminating the hopping.
Thanks again for your help.Last time I did not see your post some hours ago,because I get the answers by google reader and there is a delay until I can see it...
Josef.
here ist the image to my previous posting.
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.
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.
thank you again for this great help.I've learned a lot and my grid looks very nice now :-)
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.
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.