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

RadGrid dynamic column HorizontalAlign

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Louis-Philippe
Top achievements
Rank 1
Louis-Philippe asked on 21 Jan 2011, 06:28 PM
Hello,
I experience some odd behavior trying to set HorizontalAlign to right when using a radGrid created dynamically. The data binding is done this way:
 grid.DataSource =dataTable;
 grid.DataBind();

I'm setting the allignment this way:
grid.HorizontalAlign = HorizontalAlign.Right;
grid.HeaderStyle.HorizontalAlign = HorizontalAlign.Right;
grid.ItemStyle.HorizontalAlign = HorizontalAlign.Right;

The header is align as expected, but the rows alternate their alignment, one time right, then one time left. I tried to disable the theme with the same result.

An other strange behavior occur when the headers include an 'é' character. A space is automatically added after the character.

Thanx for your help.

1 Answer, 1 is accepted

Sort by
0
Louis-Philippe
Top achievements
Rank 1
answered on 21 Jan 2011, 09:06 PM
I found the solution to the alignment problem. You also need to set the AlternatingItemStyle like this:
grid.AlternatingItemStyle.HorizontalAlign = HorizontalAlign.Right;

Now solving the é problem...
Tags
Grid
Asked by
Louis-Philippe
Top achievements
Rank 1
Answers by
Louis-Philippe
Top achievements
Rank 1
Share this question
or