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

Gridview Formatting Issues

11 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 08 Dec 2009, 10:51 PM
Hey,

I have a problem when trying to format my Gridview text.  On my cell I set text alignment using the following:

myCell.TextAlignment = TextAlignment.Right; 
And that does what I want to do until I scroll from left to right on my GridView, at which point I get funky alignment results (I've noticed other misc. issues with the gridview control as well... issues with characters being cut off, etc. and most of them relate to scrolling).  See image for details (I blanked column names and used fake data on this example).

Is there anything I can try to fix this?  It's probably going to be a deal-breaker for this project in terms of using Telerik's gridview control.

11 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Dec 2009, 06:51 AM
Hello,

 Please set EnableColumnVirtualization to false and let me know about the result.


Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dean
Top achievements
Rank 1
answered on 09 Dec 2009, 06:31 PM
Setting EnableColumnVirtualization to false fixed the issue with alignment, but unfortunately it caused performance issues so it's not a good long-term solution for our needs (vertical scrolling is now jumpy for example).  Can we get a bug fix for this?

-Dean
0
Dean
Top achievements
Rank 1
answered on 13 Dec 2009, 09:27 PM
Any word on this yet?  It's still an issue for me.
0
Vlad
Telerik team
answered on 15 Dec 2009, 07:59 AM
Hi Dean,

 You can use template instead and if you want condition alignment you can use IValueConverter - I've attached an example project for reference.


Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Larry
Top achievements
Rank 1
answered on 01 Mar 2010, 05:19 AM
Has this been fixed yet - I'd rather not junk up my XAML with converters / templates if the 2010-1 version fixes it.
0
Vlad
Telerik team
answered on 01 Mar 2010, 07:14 AM
Hi Larry,

Condition formatting with IValueConverter is the correct way - otherwise the grid virtualization will reset your setting once the cell is recycled.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Larry
Top achievements
Rank 1
answered on 01 Mar 2010, 02:41 PM
Forgive my persistence in this matter but it would seem that the TextAlignment, being a property of the column definition, should be applied to the cell when the cell is created. Should this property not work consistently regardless of whether virtualization is on or off?
0
Vlad
Telerik team
answered on 01 Mar 2010, 02:46 PM
Hello Larry,

Indeed the column property TextAlignment will work as expeceted however if you assign cell.TextAlignment you may get such problems.

Greetings,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Larry
Top achievements
Rank 1
answered on 01 Mar 2010, 03:43 PM
Thanks again for the swift reply. I must be missing something. I'm not assigning anything in code. My XAML is as follows:

 

    <DockPanel>

        <DockPanel.Resources>

        </DockPanel.Resources>

        <worklist:workListGridHeaderPanel DockPanel.Dock="Top" />

        <tgrid:RadGridView x:Name="dataGrid1" IsReadOnly="True" IsFilteringAllowed="False"

ShowGroupPanel="False"

                           ItemsSource="{Binding}" AutoGenerateColumns="False" SelectionMode="Single"

                           RowIndicatorVisibility="Collapsed" ScrollMode="RealTime"

 DataLoadMode="Asynchronous"

                           EnableRowVirtualization="True" EnableColumnVirtualization="True"

 ShowColumnFooters="True"

                           GridLinesVisibility="Horizontal" >

    <tgrid:RadGridView.Columns>

                <tgrid:GridViewDataColumn Header="CaseSeq" UniqueName="CaseSeq" IsVisible="False"

 DataMemberBinding="{Binding CaseSeq}" />

                <tgrid:GridViewDataColumn Header="Days Remaining" UniqueName="DaysRemaining"

 DataMemberBinding="{Binding ProbationDaysRemaining}" TextAlignment="Right" />

                <tgrid:GridViewDataColumn Header="Balance" UniqueName="Balance"

DataMemberBinding="{Binding Balance}" DataFormatString="{}{0:C}"

                     TextAlignment="Right"/>

                <tgrid:GridViewDataColumn Header="CS Balance" UniqueName="CSBalance"

 DataMemberBinding="{Binding CSBalance}" TextAlignment="Right" />

            </tgrid:RadGridView.Columns>

        </tgrid:RadGridView>

    </DockPanel>



This appears fine when the grid is initially displayed but all the right-aligned fields are aligned inconsistently when scrolled (sometime left sometimes right). Are you saying this is the correct behavior?
0
Vlad
Telerik team
answered on 01 Mar 2010, 03:58 PM
Hi,

I've just tried this using our latest Q1 2010 Beta (will be released in a week officially) however everything worked as expected - you can check the attached application for reference.

All the best,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Larry
Top achievements
Rank 1
answered on 01 Mar 2010, 09:30 PM
Yes - the 2010-1 beta does appear to fix the issue.

Thanks.
Tags
GridView
Asked by
Dean
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Dean
Top achievements
Rank 1
Larry
Top achievements
Rank 1
Share this question
or