Hi,
Is there the possibility to put summary in the grouped rows?Take the xamFeatureBrowser XamDataGrid-RowSummaries-CustomStyling example:1)Set Summary Diasplay Area to TOP2)Set Group by Display Area to DataRecordsOnly3)Drag Team column and group by Team: we see two grouped rows4)Expand the first row and see the summary row right below the grouped row.What I ask is: can i have the summaries directly in the grouped row?(or can I format the option -InGroupByRecords- in a way that allow correct horizontal positions of the summary text in the corresponding column?)Another question:I need to allow users to click on summary values to perform further actions based on the source column of the selected summary value in the grouped row selected.So I have to retrieve the source colum name and also navigate somehow the hierarchical tree of the groupBy to find all the parent groups if any.How can I navigate through the GroupBy tree?
VALERIO
Hello Valerio,
Regarding formatting : You can try the StringFormat property of the SummaryDefinition. You can see an example of that in the XamFeatureBrowser under RowSUmmaries - Formatting Row Summaries.
If you want to be able to click or perform some action on the summaries, you can see an example of that in the XamFeatureBrowser under RowSummaries - Custom Button in Summary Template. For this, you would have to retemplate the SummaryResultsPresenter. You can also handle the PreviewMouseLeftButtonDown event of the XamDataGrid and use the Snoop Tool to investigate the element tree of the XamDataGrid and you application and determine what you have to find/retemplate.
Thanks for the quick replay, formatting with the stringformat could be an option, but it would surely drive me crazy, because I need to tab text in the correct column alignment and I don't want to think about allowing user to size columns and other things like that....Let me post an image of the grid i'm working on. As you can see I don't need the summary row below the header row of each group. I would like to load summaries directly in the header row. If the only option is to use SummaryDisplayArea.InGroupByRows I will manage that way....
VAlerio
Hello Alex,unfortunately I have two more questions...This is the code that allow me to set the grid with summaries on the header row itself.//display area optionsthis.xamDataGrid1.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.InGroupByRecords | SummaryDisplayAreas.TopLevelOnly;//position summary in the description row in a new line below, as the property saythis.xamDataGrid1.FieldLayoutSettings.GroupBySummaryDisplayMode = GroupBySummaryDisplayMode.SummaryCellsAlwaysBelowDescription;//put column header only on top of the gridthis.xamDataGrid1.FieldLayoutSettings.HeaderPlacement = HeaderPlacement.OnTopOnly;
You can see an example in the jpg I posted right below.As you can see, dragging two or more items in the group area to perform some more group-by correctly moves the colum headers a little to the right, depending of the increasing indentation.The problem is that the summaries in the rows of the first group-by item don't align theirselves with the other header row summaries (which are correctly aligned with the header column).It seems that no events are triggered by the first header row.My first question is simple: how can I keep summaries aligned with the proper header column?My second question: can I modify the source code to change the 'GroupBySummaryDisplayMode.SummaryCellsAlwaysBelowDescription' into a more suitable 'SummaryCellsAlwaysInTheSameLineOfDescription'? I suppose that this code change will bring the header row at its default height values.If the answer is Yes, is this modification quite simple? Could you help me writing some code? Or where can I find the class(es) to change?
Here's what I am getting when using your code. The summaries as still aligned correctly. I am using the latest service release for 9.2 (9.2.20092.2001). There must be something else affecting this behavior. Can you please give us more information on your setup/environment or put together a small isolated sample with this behavior so that we can look into it.
Thanks.
Hello Alex, you're right: with the last service release I have no more that problem!The only thing left seems to be alowing the summary be placed on the same line of the description header.I post my test project anyway if you want to work with.
Sorry here it is
So,
From what I can see, this is hard-coded inside the ControlTemplate, with a StackPanel with Orientation-Vertical. Of course, this is necessary, because if you have a summary for the first field, it will overlap with the description of the group by record.
However, if you would like to change that and you know that you will not have a overlapping summary, you can set a negative top margin or TranslateTransform.
I am attaching your project modified with this change.
You can find this style in the DefaultStyles directory in the Infragistics folder if you want to further modify it.
This solution works fine for the default style of the Grid. However, in our application we allow users to switch themes (Infragistics themes), and as soon as that happens your customization is overwritten by the theme's own implementation of the control template/style. Any suggestion as to how make this work in the theme-independent manner?
Thanks a lot.
Hello Alex,
I need to modify the style of the GroupByrecordPresenter at runtime.Can I load the style (an x:key in the xaml page targeting the igDP:GroupByRecordPresenter) in the InitializeRecord event?How can I loop through the Presenter objects to find the Group I'm looking for?Thanks in advanceVALERIO
In this case, you can modify the groupby are and move it to the right or manipulate the spacing between the group by labels. You can see example of that in the XamFeatureBrowser under XamDataGrid - Themes and Custom STyles - Custom GroupByAreaMulti Style
Yes, those properties work correctly and I've already set them.
What I would like is to avoid the whole split to the right of the layout as soon as a group is dragged into the groupArea. See the picture attacched from the previous project.
Valerio,
You can set the CellMaxWidth, LabelMaxWidth properties of the field as well as disallow resizing and/or field moving.