tablesummary column alignment

I have bound a datatable to the grid and I have added tablesummaryrow and a summaryColumn which displays the total, that is working well, took all of 10 minutes but  I've spent two hours trying to figure out horizontalalignment!


I want to right align the total in the summarycolumn

I cannot see how this is done, I must be missing something blindingly obvious because I'm sure this is something everyone would do and I just cannot see how to do it! 



5 Replies

MA Mohanram Anbukkarasu Syncfusion Team January 31, 2022 02:41 PM UTC

Hi Russ, 

You can align the table summary to right by using SfDataGrid.Style.TableSummaryRowStyle.HorizontalAlignment property as shown in the following code example.  

Code example :  

this.sfDataGrid1.Style.TableSummaryRowStyle.HorizontalAlignment = HorizontalAlignment.Right; 

Please let us know if you require any other assistance from us.  

Regards, 
Mohanram A. 



RL russ lunn January 31, 2022 02:54 PM UTC

Hi,


That seems to align the value in the summary row.

I want to align the total values under the columns.

Regards,


Russ


 



MA Mohanram Anbukkarasu Syncfusion Team February 1, 2022 11:04 AM UTC

Hi Russ, 

We suspect that your requirement is to show the summary value for the column instead of showing it for entire row. You can achieve this by enabling GridSummaryRow.ShowSummaryInRow property.  


Please revert to us with more details with illustration if we have misunderstood your requirement.   

Regards, 
Mohanram A. 



RL russ lunn February 1, 2022 12:42 PM UTC

HI there, 

thanks for your support on this, but...

if you look at that sample program you linked, you will see that the summary count value of  20 IS NOT right aligned in the column. I have annotated in red the issue.




MA Mohanram Anbukkarasu Syncfusion Team February 2, 2022 01:24 PM UTC

Hi Russ, 

We would like to let you know that it is the padding between the text and the grid lines. However, you can reduce the padding by using SfDataGrid.Style.TableSummaryRowStyle.TextMargins property as shown below.  

this.sfDataGrid1.Style.TableSummaryRowStyle.TextMargins = new Padding(0); 

Please let us know if you require further assistance from us.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon