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.
Unfortunately, activation email could not send to your email. Please try again.

Aligning column header and summaries

Thread ID:

Created:

Updated:

Platform:

Replies:

105337 Oct 2,2012 08:29 AM Oct 29,2013 04:51 AM ASP.NET MVC (Classic) 5
loading
Tags: Grid
John Hind
Asked On October 2, 2012 08:29 AM

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

Gowri S [Syncfusion]
Replied On October 4, 2012 06:24 AM

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.


John Hind
Replied On October 4, 2012 09:35 AM

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

Gowri S [Syncfusion]
Replied On October 5, 2012 08:51 AM

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.


John Hind
Replied On October 8, 2012 04:16 AM

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>

 


Thierry Fagot
Replied On October 29, 2013 04:51 AM

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>

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;