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

[Solved] RadGrid, how to center record info?

2 Answers 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 21 Jul 2009, 10:19 PM
How do you center the records in the RadGrid control?  It appears that all of the record information is aligned to the left but I want it to be center aligned.  How do I do that?  Thanks!

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Jul 2009, 04:17 AM
Hi Brett,

Set the HorizontalAlign property to Center as shown below in order to center align the item in grid.

ASPX:
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" 
    AutoGenerateEditColumn="true" DataSourceID="SqlDataSource1" GridLines="None"
    <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
        <Columns> 
          . . .  
        </Columns> 
    </MasterTableView> 
    <AlternatingItemStyle HorizontalAlign="Center" /> 
    <ItemStyle HorizontalAlign="Center" /> 
    <HeaderStyle HorizontalAlign="Center" /> 
</telerik:RadGrid> 

-Shinu.
0
Brett
Top achievements
Rank 1
answered on 22 Jul 2009, 02:31 PM
That's strange.  Even though I added those lines of code, the format of the data is still horizontally aligned left.  What gives?
Tags
General Discussions
Asked by
Brett
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Brett
Top achievements
Rank 1
Share this question
or