Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2070
Centering data columns
posted

I've seen a few threads but nothing specific, so I will ask again: I am using the WebDataGrid and the RubberBlack style. In addition to using this style, I also want to CENTER my data columns. There should be an align property for a column but obviously there isn't.

So... when using a theme how can I center or otherwise manipulate the style (such as setting a column bold or setting a column to center-align)?

/Tom

Parents
No Data
Reply
  • 33839
    Suggested Answer
    posted

    Hey Tom,

    This should be possible by setting the CssClass property of the column in question.  You'll want to define your custom class like follows.  It needs the selectors in order to override what is set in the classes of the StyleSet.

    tbody > tr > td.custom
            {
                font-weight: bold;
                text-align: center;
                color : Blue;
            }

    .customHeader

    {
                font-weight: bold;
                text-align: center;

    }

    This will only affect the cells.  To affect the footer and header, the css class for those parts of the column will need to be set.

    <ig:BoundDataField DataFieldName="Name" Key="Name" CssClass="custom">
                        <Header Text="Name" CssClass="customHeader" />
                    </ig:BoundDataField>

    The customHeader class doesn't need selectors since our .igg_HeaderCaption doesn't use them.  Hopefully, this gets you rolling with styling your columns.

     

    regards,

    David Young

Children