This is a migrated thread and some comments may be shown as answers.

Header and Footer Alignment

6 Answers 431 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel Kraft
Top achievements
Rank 2
Joel Kraft asked on 12 Feb 2008, 01:10 AM
I am having trouble setting the alignment on my headers and footers:
FooterStyle-HorizontalAlign="Center"
HeaderStyle-HorizontalAlign="Center"

No matter what I do with the latest build, the headers and footers are all left-aligned. When I look at the source, there are not any alignments listed on the associated TDs.

The ItemStyle version works correctly, though.

Is this a bug in the 2007.3 SP1 version?
Joel

6 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 13 Feb 2008, 04:07 PM
Hi Joel,

I tested the control and the properties were properly applied.
Attached to this message, you will find the code, which I used for testing.
Take a look at it and let me know if this is the expected functionality, or I am leaving something out.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Joel Kraft
Top achievements
Rank 2
answered on 13 Feb 2008, 04:37 PM
Well I'm looking at your markup and I don't see my issue addressed in there.  Here are the additions to your sample to illustrate the problem.

Joel

<rad:RadGrid ID="RadGrid1"  runat="server" DataSourceID="AccessDataSource1" GridLines="None" AllowSorting="True">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="EmployeeID" DataSourceID="AccessDataSource1"
AllowMultiColumnSorting="true" ShowFooter="True">
  <RowIndicatorColumn Visible="False">
    <HeaderStyle Width="20px" />
  </RowIndicatorColumn>
  <ExpandCollapseColumn Resizable="False" Visible="False">
    <HeaderStyle Width="20px" />
  </ExpandCollapseColumn>
  <Columns>
   <rad:GridBoundColumn DataField="EmployeeID" DataType="System.Int32" HeaderText="EmployeeID"
         ReadOnly="True" SortExpression="EmployeeID" UniqueName="EmployeeID" />
    <rad:GridBoundColumn DataField="LastName" HeaderText="LastName" SortExpression="LastName"
         UniqueName="LastName" />
    <rad:GridBoundColumn DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName"
         UniqueName="FirstName" />
    <rad:GridBoundColumn DataField="BirthDate" DataType="System.DateTime" HeaderText="BirthDate"
         SortExpression="BirthDate" UniqueName="BirthDate" DataFormatString={0:dd-MMM-yyyy:hh:mm:ss}
HeaderStyle-HorizontalAlign="Center"
FooterStyle-HorizontalAlign="Center" FooterText="Stuff">
  </Columns>
</MasterTableView>
<ClientSettings>
  <Resizing AllowColumnResize="true" />
</ClientSettings>
</rad:RadGrid>

0
prismcarlson
Top achievements
Rank 1
answered on 14 Feb 2008, 08:38 PM
I experience this same issue. Anyone know of a work around or a fix?

I have been able to achieve some success in aligning the headers by customizing the CSS of the default skin. However once I set UseEmbeddedSkin to false and map to my image directory (and move all telerik images to the directory ~images/Grid/*images*) None of the images will display properly at run time when I sort, filter, etc. Just receive a dreaded red-x, image not found.

Any other ideas, thoughts?
0
Yavor
Telerik team
answered on 18 Feb 2008, 09:30 AM
Hi Joel,

In order to make sure that the item is properly alligned, you can take the following approach:

.css
 <style type="text/css">  
      
    .class1  
    {  
      text-align:center;  
    }  
      
    </style> 


.cs
 protected void RadGrid1_PreRender(object source, System.EventArgs e)  
    {  
        GridFooterItem footerItem = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];  
        footerItem.CssClass = "class1";  
    } 

Let me know if this helps.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Joel Kraft
Top achievements
Rank 2
answered on 25 Feb 2008, 03:10 PM
Thats fine as a workaround, but shouldn't be necessary in the long run.

Will this be fixed in the next service pack?
0
Yavor
Telerik team
answered on 28 Feb 2008, 11:31 AM
Hi Joel,

Indeed, we will address the issue in one of the next versions of the product. I hope that the suggested work-around works properly in the meantime.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Joel Kraft
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Joel Kraft
Top achievements
Rank 2
prismcarlson
Top achievements
Rank 1
Share this question
or