We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Aligning column header and summaries

How do I right aligning column header text and summary totals ?
 
thanks
John

5 Replies

GS Gowri S Syncfusion Team October 4, 2012 10:24 AM UTC

Hi John,

Thanks for using Syncfusion products.

We suggest you to use the following lines in your cshtml file to align the columns and summaries :

<style type="text/css">

.Summary, .HeaderCellDiv

{

    text-align:right!important;

}

</style>

Please let us know if you have any other concerns.

Regards,

Gowri S.



JH John Hind October 4, 2012 01:35 PM UTC

Hi, thanks for the reply.
 
That CSS will change all column headers to right aligned, but I only need to do certain columns. Is it possible to align the header text when I create each column in the View ? I can call .TextAlign(TextAlignment.Right) to align the data but not the header.
 
thanks,
John


GS Gowri S Syncfusion Team October 5, 2012 12:51 PM UTC

Hi John,

 

Thanks for your update.

 

We have no support for alignment of column header text and summaries in Grid.

 

We request you to create an incident using your Direct Trac account and follow that incident.

 

Please let us know if you have any concerns.

 

Regards,

 

Gowri S.



JH John Hind October 8, 2012 08:16 AM UTC

I created an Incident Request and got this reply which works perfectly !! Well done guys....
 
    <script type="text/javascript">
 
     $(document).ready(function () {
         $("tr.HeaderBar th:contains('Order No')").find("div.HeaderCellDiv").css("text-align", "right");
     });
 
    </script>

 



TF Thierry Fagot October 29, 2013 08:51 AM UTC

The code to resolve your problem is :

<script type="text/javascript">
    $(document).ready(function () {
      
        // Initialiser l'alignement des totaux des grilles SyncFusion
        $('td.Summary').each(function (index, elem) {
            var value = $(this).text();
            var istext = /[a-zA-Z]+$/.test(value);

            if (istext == false) {
                $(this).css("text-align", "right");
            }
        });
    });
</script>

Loader.
Live Chat Icon For mobile
Up arrow icon