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

RadGridView : How to disable the horizontal scrollbar of the RowDetails

2 Answers 630 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jean
Top achievements
Rank 1
Jean asked on 15 Apr 2011, 02:20 PM
Hello,

I have pretty much the same problem describe in that post : http://www.telerik.com/community/forums/wpf/gridview/rowdetailstemplate-and-text-wrapping.aspx .

Inside my RowDetails I have a control with some textblocs (set to warp). I dont want the horizontal scrollbar, to make my textblock warp.

The difference with the previous link is that I dont want to set the RadGridView width to a constant value. (to follow the window size)

I want the RowDetails width to be the same as the RadGridView width. I've set the ScrollViewer.HorizontalScrollBarVisibility= to "Disabled"

So I tried to bind the MaxWidth of my control inside the RowDetails value with RadGridView but it doesnt work (textblocs don't warp and horizontal scrollbar is still on)

this is my code :

<telerikGrid:RadGridView x:Name="MRUList" 
            ItemsSource="{Binding MRUSupplierItems, Mode=TwoWay}"  
            SelectedItem="{Binding CurrentSelectedSupplierItem, Mode=TwoWay}"
            Grid.Row="1" d:LayoutOverrides="Width" VerticalAlignment="Top"
            IsSynchronizedWithCurrentItem="True" 
            RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" IsFilteringAllowed="False"
            AutoGenerateColumns="False" CanUserInsertRows="False" RowDetailsVisibilityMode="Collapsed"
            IsReadOnly="True" CanUserDeleteRows="True"
            CanUserFreezeColumns="False" Margin="2,2,2,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
         >
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleBrandName, Source={StaticResource Resource}}" UniqueName="PriceList_Name" DataMemberBinding="{Binding PriceList_Name}" IsSortable="True"/>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductRef, Source={StaticResource Resource}}" UniqueName="Reference" DataMemberBinding="{Binding Reference}" IsSortable="True"/>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductName, Source={StaticResource Resource}}" Width="*" UniqueName="Name" DataMemberBinding="{Binding Name}" IsSortable="True" />
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductPrice, Source={StaticResource Resource}}" UniqueName="Price" DataMemberBinding="{Binding PublicPrice}" IsSortable="True" />
            </telerikGrid:RadGridView.Columns>
              
            <telerikGrid:RadGridView.RowDetailsTemplate>
                <DataTemplate x:Name="RowDetailsProvider">
                    <local:SupplierItemUserControl 
                        MaxWidth="{Binding Width, ElementName=MRUList}"
                        AddItemToQuotationCommand="{Binding ElementName=ElytecMRUUC, Path=DataContext.AddItemToQuotationCommand, Mode=TwoWay}"
                        AddItemToCartCommand="{Binding ElementName=ElytecMRUUC, Path=DataContext.AddItemToCartCommand, Mode=TwoWay}"
                        DisplayAddToCart="True"
                        DisplayAddToQuotation="{Binding IsCurrentQuotationAvailable, Mode=OneWay}"
                        DisplayRemoveFromCart="False"
                    />
                </DataTemplate>
            </telerikGrid:RadGridView.RowDetailsTemplate>
              
        </telerikGrid:RadGridView>

Thanks for your help!

Regards.

2 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 18 Apr 2011, 11:53 AM
Hi Olivier,

Unfortunately, that would not be possible.

The only possible way would be to define a width for the grid or for the control inside the row details template.

All the best,
Ross
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
Jean
Top achievements
Rank 1
answered on 05 May 2011, 11:04 AM
Thanks for the answer,

Regards !
Tags
GridView
Asked by
Jean
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jean
Top achievements
Rank 1
Share this question
or