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

Grid Column Filter auto-resizing and incorrect scrolling

7 Answers 653 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 14 Dec 2010, 08:51 PM
This is happening on what appears to be a ListBox inside the filter that contains a CheckBox element for each distinct RowValue in the column.  
When scrolling, the width of the ListBox changes depending upon the size of the widest checkbox in the list.  

Also, the only way to use the scroll bar is to click either the up or down arrow, wait for the ListBox to resize, then click the arrows again.  Attempting to move the actual bar of the ScrollBar does not scroll the ListBox with CheckBoxes, it instead scrolls the bar of the GridView itself. 


Is there a way to set the ListBox width to that of the widest CheckBox?

7 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 15 Dec 2010, 09:08 AM
Hi Artel,

The easiest way to overcome this behavior is to create an implicit style and set the MinWidth and MaxWidth of the filtering control:

<Style TargetType="telerik:FilteringControl">               
    <Setter Property="MinWidth" Value="300" />
    <Setter Property="MaxWidth" Value="300" />
</Style>

Let me know if this helps.

Greetings,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Jason
Top achievements
Rank 1
answered on 15 Dec 2010, 04:58 PM
Awesome, thats works perfectly for solving my first issue.  I still however have the scrolling issue.  Whenever I scroll the ScrollBar on both the horizontal and vertical ScrollBars, it scrolls the ScrollBar on the GridView, not the FilteringControl.

Thanks Again!
0
Accepted
Vlad
Telerik team
answered on 16 Dec 2010, 08:10 AM
Hi,

 This in known issue in WPF in general with nested ScrollViewers and IsDeferredScrollingEnabled set to true. Please set ScrollMode  to RealTime for the grid to avoid this. 

Greetings,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Jason
Top achievements
Rank 1
answered on 16 Dec 2010, 05:27 PM
Thank you guys very much!  Both of my issues have been resolved!
0
Anitha
Top achievements
Rank 1
answered on 17 Feb 2011, 07:37 AM
Hi,
I  tried the below sample code

<Style TargetType="telerik:FilteringControl">               
    <Setter Property="MinWidth" Value="300" />
    <Setter Property="MaxWidth" Value="300" />
</Style>

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=EmpName}" Header="EmployeeName" IsReadOnly="True" Width="auto" ShowFieldFilters="True" ShowDistinctFilters="True" MaxWidth="200" FilteringControl="{Binding Path=radgrid}" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Addr}" Header="Address" IsReadOnly="True" Width="auto" ShowDistinctFilters="True" ShowFieldFilters="True" MaxWidth="200" FilteringControl="{Binding radgrid}" />

 

</telerik:RadGridView.Columns>

if i am bind like this FilteringControl="{Binding Path=radgrid}" />
i'm getting the following error


Set property 'Telerik.Windows.Controls.GridViewBoundColumnBase.FilteringControl' threw an exception. [Line: 41 Position: 225]

How to set my style property in my XAML?.

thanks &regards
ANNT
0
Vlad
Telerik team
answered on 17 Feb 2011, 08:12 AM
Hello,

 I'm not sure what exactly this binding (FilteringControl="{Binding Path=radgrid}") should do - can you clarify? 

Greetings,
Vlad
the Telerik team
0
Anitha
Top achievements
Rank 1
answered on 17 Feb 2011, 08:22 AM

<

 

 

navigation:Page.Resources 

 

<CollectionViewSource x:Key="empdetailViewSource" d:DesignSource="{d:DesignInstance my:Empdetail, CreateList

=True}" />

<Style x:Key="radgrid" TargetType="telerik:FilteringControl">

<Setter Property="MinHeight" Value="300" />

 

<Setter Property="MaxHeight" Value="300" />

 

 

</Style>

 

 

</navigation:Page.Resources>

 

 

<Grid x:Name="LayoutRoot" DataContext="{StaticResource empdetailViewSource}" Background="Wheat" Height="373" Width="800" >
<
telerik:RadGridView Margin="6,21,11,0" Name="radGridView1" VerticalAlignment="Top" Height="114" ItemsSource="{Binding}" CanUserFreezeColumns="False" AutoGenerateColumns="False" FrozenColumnCount="7" RowDetailsVisibilityMode="Collapsed" ShowGroupPanel

 

="False"

 

 

Grid.Row="1" IsReadOnly="True" telerik:StyleManager.Theme="Windows7" Width="616" CanUserResizeColumns="True" CanUserReorderColumns

="True">

 

<

 

 

telerik:RadGridView.Columns >

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=EmpName}" Header="EmployeeName" IsReadOnly="True" Width="auto" ShowFieldFilters="True" ShowDistinctFilters="True" MaxWidth="200" FilteringControl="{Binding Path=radgrid}"

/>

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Addr}" Header="Address" IsReadOnly="True" Width="auto" ShowDistinctFilters="True" ShowFieldFilters="True" MaxWidth="200" FilteringControl="{Binding radgrid}"

/>

 

 

 </telerik:RadGridView.Columns >

 

 

 

 

</telerik:RadGridView >

 

 

 

 

</grid>

i used this code in my application while i run the application
the filter pop full view can't appear in browser page.
it s go beyond the page?
i need to resize the filter with in the page? can u help me?

thanks&regards,
ANNT


Tags
GridView
Asked by
Jason
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Jason
Top achievements
Rank 1
Vlad
Telerik team
Anitha
Top achievements
Rank 1
Share this question
or