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

How to prevent RadGridView auto row resizing?

5 Answers 686 Views
GridView
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 29 Aug 2011, 02:53 PM
I have a telerik RadGridView in which some columns can have a lot of data causing them to go multiline, which is fine. However, when we scroll horizontally and those multiline column data is out of view, the rows resize back to single line. We would like to avoid this.

DataGridView has a AutoSizeRowsMode but I can't find an equivalent RadGridView property.

Help?

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 29 Aug 2011, 02:58 PM
Hi,

 You can set MaxHeight for GridViewRow using implicit style. 

All the best,
Vlad
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
William
Top achievements
Rank 1
answered on 29 Aug 2011, 04:04 PM
Thanks for the fast reply.

Unfortunately, I don't want to limit the height of the row that it can get as my multi-line values should be displayed in full. I simply want the grid to not resize when that column is out of view.
0
Vlad
Telerik team
answered on 29 Aug 2011, 04:07 PM
Hello,

 You can try to turn off the horizontal virtualization - EnableColumnVirtualization=False.

Kind regards,
Vlad
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
William
Top achievements
Rank 1
answered on 29 Aug 2011, 08:22 PM
No luck, still stuck. Here is my grid:

               <Controls:RadGridView x:Name="TelerikGrid" AutoGenerateColumns="False" ItemsSource="{Binding Path=EventsRecords}" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"
                                      Background="{DynamicResource ContainerBackground}" IsReadOnly="True" Filtered="EventsView_Filtered" EnableColumnVirtualization="false">
                    <Controls:RadGridView.Columns>
                        <Controls:GridViewDataColumn DataMemberBinding="{Binding DisplayHeader}" Header="{x:Static Templates:Res.EventsRecordDisplayHeaderColumn}" />
                        <Controls:GridViewDataColumn DataMemberBinding="{Binding ParsedEventDetails}" Header="{x:Static Templates:Res.EventsRecordParsedEventDetailsColumn}"/>
                        <Controls:GridViewDataColumn DataMemberBinding="{Binding SequenceNumber}" Header="{x:Static Templates:Res.EventsRecordSequenceNumberColumn}" />
                        <Controls:GridViewDataColumn DataMemberBinding="{Binding ReceivedTime}" Header="{x:Static Templates:Res.EventsRecordReceivedTimeColumn}">
                            <Controls:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock>
                                        <TextBlock.Text>
                                            <MultiBinding Converter="{markup:TimeZoneConverter}" ConverterParameter="DateTime" ConverterCulture="{x:Static Globalization:CultureInfo.CurrentCulture}">
                                                <Binding Path="ReceivedTime"/>
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Item[PresentationTimeZone]"/>
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Item[StandardAbbreviation]"/>
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Item[DaylightAbbreviation]"/>
                                            </MultiBinding>
                                        </TextBlock.Text>
                                    </TextBlock>
                                </DataTemplate>
                            </Controls:GridViewDataColumn.CellTemplate>
                        </Controls:GridViewDataColumn>
                        <Controls:GridViewDataColumn DataMemberBinding="{Binding EventTimestamp}" Header="{x:Static Templates:Res.EventsRecordEventTimestampColumn}">
                            <Controls:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock>
                                        <TextBlock.Text>
                                            <MultiBinding Converter="{markup:TimeZoneConverter}" ConverterParameter="DateTime" ConverterCulture="{x:Static Globalization:CultureInfo.CurrentCulture}">
                                                <Binding Path="EventTimestamp"/>
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Item[PresentationTimeZone]"/>
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Item[StandardAbbreviation]"/>
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Item[DaylightAbbreviation]"/>
                                            </MultiBinding>
                                        </TextBlock.Text>
                                    </TextBlock>
                                </DataTemplate>
                            </Controls:GridViewDataColumn.CellTemplate>
                        </Controls:GridViewDataColumn>
                        <Controls:GridViewDataColumn DataMemberBinding="{Binding Description}"  Header="{x:Static Templates:Res.EventRecordDescriptionColumn}" />
                    </Controls:RadGridView.Columns>
                </Controls:RadGridView>
0
Pavel Pavlov
Telerik team
answered on 01 Sep 2011, 03:04 PM
Hi William,

In the case of custom cell template, you may set the max height of the TextBlocks you have placed inside the cells . This should do the trick.

Greetings,
Pavel Pavlov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
William
Top achievements
Rank 1
Answers by
Vlad
Telerik team
William
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or