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

Issue with RadGrid HorizontalAlign Setting

5 Answers 588 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kiresh
Top achievements
Rank 1
Kiresh asked on 24 Jun 2013, 12:19 PM
Hello everyone,

i have one issue with RadGrid

i want to align my items to right and i tried so many ways

1)<ItemStyle HorizontalAlign="Right" />
2)ItemStyle-HorizontalAlign="Right"

but this doesn't seems to work in my grid

Can anyone help me out?

Thanks,

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2013, 01:07 PM
Hi,

I guess you want to present the content of your grid instance in a right-to-left direction. Please try setting the MasterTableView property Dir to RTL. Please check this help documentation.

Thanks,
Shinu.
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2013, 01:10 PM
Hi,

i guess you want to present the content of your RadGrid instance in a right to left direction. Please try setting the MasterTableView property Dir to RTL. Please have a look at this documentation which describe about Right to Left support.

Thanks,
Shinu.
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2013, 01:13 PM
Hi,

i guess you want to present the content of your RadGrid instance in a right to left direction. Please try setting the MasterTableView property Dir to RTL. Please have a look at this documentation which describe about Right to Left support.

Thanks,
Shinu.
0
Kiresh
Top achievements
Rank 1
answered on 01 Jul 2013, 08:35 AM
Hi

here is my code
<Columns>
                <telerik:GridBoundColumn DataField="abc" HeaderText="abc" UniqueName="abc"
                        DataFormatString="{0:c}">
                        <HeaderStyle Width="50px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                      </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="name" HeaderText="name" UniqueName="name"
                        DataFormatString="{0:c}">
                        <HeaderStyle Width="50px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                      </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="Percentage" HeaderText="%" UniqueName="Percentage"
                        DataFormatString="{0}%">
                        <HeaderStyle Width="50px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                      </telerik:GridBoundColumn>
</Columns>


but nots working , the one magic is that this working after i have added and new entry in grid.

Thanks
0
Princy
Top achievements
Rank 2
answered on 02 Jul 2013, 06:27 AM
Hi Kiresh,

You code works fine at my end.Please try setting the Style as below and check if it helps.
You can set the Header and Item style common to all BoundColumns in aspx as below.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server"  GridLines="None" >
    <MasterTableView>
       <HeaderStyle HorizontalAlign="Center" />
        <ItemStyle HorizontalAlign="Right" />
        <AlternatingItemStyle HorizontalAlign="Right" />
        <Columns>
            <telerik:GridBoundColumn DataField="OrderID" HeaderText="OrderID" UniqueName="OrderID">           
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity">            
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>  
</telerik:RadGrid>

OR
You can set it in the PreRender event of you radgrid.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    RadGrid1.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
    RadGrid1.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
    RadGrid1.AlternatingItemStyle.HorizontalAlign = HorizontalAlign.Right;
}

Thanks,
Princy
Tags
Grid
Asked by
Kiresh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kiresh
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or