I have a requirement where in I am using a Custom summary type of UltraGrid.
All the columns in the group by rows are aligned to right by default.
Now I want the text in a column to be left aligned. Is there a property which will help me achieve this.
I have tried the below code which did not work for me.
Please help
Thank You
Hello Mike,
Implemented the event and the code you suggested, and it is fulfilling my requirement.
Thank You,
Shambu Sathyan
Hi Shambu,
Okay, I see the problem, now. The GroupBySummaryValueAppearance (which you hadn't mentioned until now) is considered more specific than the SummarySettings.Appearance. So it takes precedence.
So what you need to do is set the GroupBySummaryValueAppearance on the SummaryValue, not the SummarySettings. The only question then is - when to do it. There's no event for when a new SummaryValue is initialized. But there is an event for when the summary is calculated. So I would do this:
Private Sub ulGridEstimateDetail_SummaryValueChanged(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.SummaryValueChangedEventArgs) Handles ulGridEstimateDetail.SummaryValueChanged Select Case e.SummaryValue.Key Case "UNIT" e.SummaryValue.GroupBySummaryValueAppearance.TextHAlign = HAlign.Left Case Else e.SummaryValue.GroupBySummaryValueAppearance.TextHAlign = HAlign.Right End Select End Sub
This is a bit inefficient, since you will end up setting and re-setting the alignment every time the summary value is recalculated. But it's not that bad, since this will be a no-op after the first time, anyway.
Hello Mike Saltzman And Boris Toromanov,
I have attached the sample project to reproduce the issue.
We have the below code written in the initialize layout of the grid to set the Summary text to display the text in the header column of the specific field.
ulGridEstimateDetail.DisplayLayout.Override.GroupBySummaryDisplayStyle = GroupBySummaryDisplayStyle.SummaryCellsulGridEstimateDetail.DisplayLayout.Override.GroupBySummaryValueAppearance.TextHAlign = HAlign.Right
What this does is, it aligns all the columns in the summary to the right, I want to align the text as per the content in the header. That is if it is a numeric value I want to align it to right or else to left.
Hello Shambu,
Could you please try to attach if possible a small sample project reproducing the above mentioned issue, I will be happy to take a look at it.
Hi,
I tried this out and my summary text is aligned to the left by default without setting any appearances. So I'm not sure why it's not working for you. Maybe something else in your code is explicitly setting the alignment to Right after you are setting it with the code here.
If that's not the case, then maybe you could post a small sample project demonstrating the issue so I can take a look.