Hi
Attached SummaryCellsTextOverlap.zip has source code files and also has GroupTextOverlap.PNG for existing and expected results.
I am trying to do sum aggragation on ID and group by on Abbreviation colums. Right now in result, Abbreviation group by text is overlaping other summary cells (IDName and ID).
Is there a way to fit the group by text in the first cell?. Check GroupTextOverlap.PNG for expected result.
Can you modify the attached source with solution and post in this.
Thanks in advance.
Thanks for the response.
I tried to add the code in attached sample (inside zip) and able to achieve for First group by. I had to use tag (to maintain old value) to fit the text.
Let me know this solution is right way of implementing.
Also I would like this truncate logic to applied on Second group by (third, fourth so on). Check the "GroupTruncate.png" file in attached zip for the result that I am expecting. I did tried a bit and had no luck on this. Can you modify the attached source and upload back.
Hi,
You can use the SizeChanged event of the label presenter with Style/Setter and then retrieve the GroupByRecord and change the description. In your code you already had a logic that you used in the Grouped event. You can use similar logic in SizeChanged event. Here is the code example to achieve it.
// Style
<Style x:Key="lp" TargetType="{x:Type igDP:LabelPresenter}">
<EventSetter Event="SizeChanged" Handler="OnColumnSizeChanged"/>
</Style>
// Field settings
<igDP:Field Name="Abbreviation">
<igDP:Field.Settings>
<igDP:FieldSettings LabelPresenterStyle="{StaticResource lp}"/>
</igDP:Field.Settings>
</igDP:Field>
// Handling event. This event will get raised every time the columns are resized.
void OnColumnSizeChanged(object sender, SizeChangedEventArgs e)
{
foreach (var item in xamDataGrid1.Records)
GroupByRecord dr = item as GroupByRecord;
if (dr != null)
if (dr.GroupByField.LabelWidthResolved < 99)
item.Description = "Here is GroupBy...";
}
else
item.Description = "Here is GroupBy record's description";
Let me know how this worked for you.
Thank you,
Sam
I am expecting the result as in screen shot.
In screen shot truncast text was result using image editor (to show for the result that I am expecting).
Issue I am having that Group by text is being overlapping on other summary cells text (ex: Abbreviation column group by text is overlapping on ID column summary data
Is there a way we can truncate the text based on width and on column resize it should show the text that fits in the available width?.
For sample, please use the code attached in previous posts.
Hello,
Sorry for the delay, I did not receive email notification of you earlier question.
The width of the GroupBy record is not synchronized with the column width, meaning resizing the column width does not reflect the width of the GroupBy record or vice versa. The GroupBy record takes up the entire width of the grid.
I noticed in your screenshot that the label area in the GroupBy record is truncated. Unless you explicitly set the width of the control template, the label area in GroupBy record should not truncate. I have not seen that behavior in the attached sample.
Can you please modify the sample so you can reproduce the behavior and I will take a look?
Any update on this request?