hyperlink column header alignment in client-side bound grid

2 posts, 0 answers
  1. Albert Shenker
    Albert Shenker avatar
    588 posts
    Member since:
    Mar 2004

    Posted 19 May 2016 Link to this post

    I have a grid with the following declaration. The grid is bound client-side. For some reason, I can't get the HyperlinkColumn to display its text centered. (see attached image). Any idea why?


    <telerik:RadGrid id="rgCEE"
                                                <telerik:GridHyperlinkColumn UniqueName="SelectColumn" Text="Select" DataNavigateUrlFields="EmployeeId" DataNavigateUrlFormatString="javascript:SelectExistingEmployee_CO({0});"  >
                                                    <HeaderStyle Width="100px" HorizontalAlign="Center" />
                                                    <ItemStyle HorizontalAlign="Center" />
                                                <telerik:GridDateTimeColumn HeaderText="Born" DataField="BirthDate" DataType="System.DateTime" DataFormatString="{0:MM/dd/yy}">
                                                    <HeaderStyle width="80px" HorizontalAlign="Left" ></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle"></ItemStyle>
                                                <telerik:GridTemplateColumn UniqueName="spacerCol"></telerik:GridTemplateColumn>
                                        <ClientSettings AllowExpandCollapse="True" >
                                            <Selecting AllowRowSelect="False" EnableDragToSelectRows="False"  />
                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="100%" />
                                            <Resizing AllowColumnResize="False" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"/>
                                            <ClientEvents OnGridCreated="rgCEECreatedHandler_CO"/>

  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 24 May 2016 Link to this post

    Hi Albert,

    I have tested the column configuration on my side and everything seems to work correctly and the anchor element is centered within the cell. Could you please inspect the generated TD element and the applied styles and see if the "center" value is added?

    On a side note, you could try to add custom CSS class to the TD element and see if that makes any difference:
    <telerik:GridHyperLinkColumn UniqueName="SelectColumn" Text="Select" DataNavigateUrlFields="EmployeeId"
        <HeaderStyle Width="100px" HorizontalAlign="Center" />
        <ItemStyle CssClass="hyperlinkcolumn" />
    .hyperlinkcolumn {
        text-align: center;

    Looking forward to your reply with the result.

    Konstantin Dikov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top