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

Fixing filter dropdown width

1 Answer 72 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi
Top achievements
Rank 1
Avi asked on 05 Sep 2011, 03:13 PM
Hi Support,
In my grid view I am displaying a large strings in one column, SO when user tries to filter it,Filter Drop down goes out ot the windows frame,
SO I just want to fix filter drop down width,  I tried the XAML below , but with no help.

  <UserControl.Resources>    
        <Style TargetType="telerik:FilteringControl" x:Key="RowFilteringWidth">
            <Setter Property="MaxWidth" Value="220"/>
        </Style>
    </UserControl.Resources>
 
<telerik:RadGridView Grid.Row="1"
                             CanUserSelect="False"
                             ItemsSource="{Binding DepositCollection}"
                             ScrollViewer.VerticalScrollBarVisibility="Auto"
                             SelectedItem="{Binding SelectedDeposit, Mode=TwoWay}"
                             Visibility="{Binding HasDepositData, Converter={StaticResource booleanToVisibilityConverter}}"
                             DataContext="{StaticResource RowFilteringWidth}"
                             >

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 05 Sep 2011, 03:40 PM
Hello Avi,



Indeed when there is not enough space around RadGridView the FilteringControl is being clipped. 
Everything in your style seems to work correctly, however it is not assigned on the right place. 
A style targeted at RadGridView's FilteringControl can be assigned on a column not on the RadGridView's DataContext and everything should work as expected:


<telerik:GridViewDataColumn FilteringControlStyle="{StaticResource RowFilteringWidth}" DataMemberBinding="{Binding LastName}" Header="Last Name"/>


If you mark this style as an implicit through removing the x:Key attribute it will be applied to all columns in RadGridView. I am not quite sure how you defined the columns, however the approach in code-behind is the same: 

column.FilteringControlStyle = this.Resources["RowFilteringWidth
"
] as Style;


Furthermore in our online documentation you will find a troubleshooting article which might be of help, follow this link.


Best wishes,
Vanya Pavlova
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
Avi
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or