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

Inconsistent alignment in RadGrid column

2 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stepan
Top achievements
Rank 1
Stepan asked on 22 Sep 2011, 04:19 AM
Hello,

We are experiencing strange alignment problem in one (numeric) rad grid column. Please see attached picture.
Given
HorizontalAlign="Right"  and AllowScroll="True", the alignment changes after PageSize rows.
How can we work around this?


<
telerik:RadGrid id="RadGridTreb" runat="server" AutoGenerateColumns="False" 
               AllowMultiRowSelection="True" AllowSorting="True" GridLines="None"
               Culture="ru-RU"
               Width="100%" EnableEmbeddedSkins="False" OnPreRender="RadGrid_PreRender"
               Height="300px" EnableViewState="False" OnInit="RadGridTreb_Init">
             
<ExportSettings FileName="PlatCalendar"> </ExportSettings>
       <ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True">
  
<Selecting AllowRowSelect="True"></Selecting>
  
       <DataBinding FilterParameterType="Linq" Location="FinanceService.asmx"
                  SelectMethod="GetRowsTableLinq" SortParameterType="Linq">
       </DataBinding>
<Scrolling AllowScroll="True" SaveScrollPosition="True" />
  
  
<Columns>
  
* * *
<telerik:GridCalculatedColumn DataFields="CRE_AMOUNT_EFFECT"
                          HeaderText="Сумма" DataType="System.Decimal"
                         UniqueName="CRE_AMOUNT_EFFECT" Expression="{0}">
                         <HeaderStyle  Width="80px" HorizontalAlign="Center" ></HeaderStyle>
                         <ItemStyle Width="80px" HorizontalAlign="Right" ></ItemStyle >
                       </telerik:GridCalculatedColumn>
  
       * * *

Best regards,
Maxim

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 22 Sep 2011, 07:24 AM
Hello Maxim,

This behavior is due to the fact that RadGrid serialize its ItemStyle on client. Thus the style will be applied only for the rows that are initially rendered from server.
You can handle RowDataBound client event and apply the style for all desired table cells for current item that is being bound in order to workaround this behavior.

http://www.telerik.com/help/aspnet-ajax/client-side-binding.html
http://www.telerik.com/help/aspnet-ajax/client-side-binding-specifics.html

I hope this helps.

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Stepan
Top achievements
Rank 1
answered on 22 Sep 2011, 09:13 AM
Thank you for instant reply, our problem is solved.

Best regards,
Maxim
Tags
Grid
Asked by
Stepan
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Stepan
Top achievements
Rank 1
Share this question
or