Telerik Forums
UI for WPF Forum
1 answer
7 views

1. Go to the GridView | Filtering Configuration example in the Telerik WPF Demo app.

2. Choose Popup for Filtering Mode.

3. Open filtering for Company Name.

4. Alt-Tab to another app window.

5. Observe as filter window appears on top of the app's window.

Is this expected behaviour?

Martin Ivanov
Telerik team
 answered on 29 Apr 2025
1 answer
21 views

When reading https://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/self-referencing-grid I was expecting that `Self-Referencing` RadGridView means it uses own columns and rest visual stuff to display all nested child RadGridViews. Since it references the same type in the underlying data on every hierarchy level (that is self-referencing), it's obviously should display all levels in the same way (as it displays itself on top-level). 

Turned out it was not the case. Each child level requires own visual template, own columns with own styling. We have about 20 columns with heavy styling each (more than 500 lines in .xaml) for top-level `RadGridView`. Copy-pasting all that into `RadGridView.HierarchyChildTemplate` is not an option.

In your demo application, I saw that you add columns manually for a child `RadGridView` from `RadGridView1_DataLoading` handler in code-behind. I was hoping it was a mistake.

 

Martin Ivanov
Telerik team
 answered on 08 Apr 2025
1 answer
19 views

Hello,

In our app we are using filtering through a RadGridView bound to a QueryableCollectionView that wraps an ObservableCollection. Now I'm trying to use that filtered QueryableCollectionView as the ItemSource for a VisualizationLayer in a RadMap so that the filter on the grid also applies to items shown on the map, but the bind fails with the following error: "System.ArgumentException: 'Telerik.Windows.Data.QueryableCollectionView' is not a valid value for property 'Source'."

I've attached a quick project replicating the issue with the relevant code in MainWindow.xaml:

            <!-- Doesn't work -->
            <telerik:VisualizationLayer ItemsSource="{Binding ItemViewModelsView }" ItemSelectionMode="None">
                <telerik:VisualizationLayer.ItemTemplate>
                    <DataTemplate DataType="{x:Type local:ItemViewModel}">
                        <Ellipse Fill="Blue" Width="12" Height="12" telerik:MapLayer.Location="{Binding Location}"/>
                    </DataTemplate>
                </telerik:VisualizationLayer.ItemTemplate>
            </telerik:VisualizationLayer>
            
            <!-- Also doesn't work pulling directly from the GridView -->
            <telerik:VisualizationLayer ItemsSource="{Binding Items, ElementName=GridView }" ItemSelectionMode="None">
                <telerik:VisualizationLayer.ItemTemplate>
                    <DataTemplate DataType="{x:Type local:ItemViewModel}">
                        <Ellipse Fill="Blue" Width="12" Height="12" telerik:MapLayer.Location="{Binding Location}"/>
                    </DataTemplate>
                </telerik:VisualizationLayer.ItemTemplate>
            </telerik:VisualizationLayer>
            
            <!-- Works but isn't filtered -->
            <telerik:VisualizationLayer ItemsSource="{Binding ItemViewModels }" ItemSelectionMode="None">
                <telerik:VisualizationLayer.ItemTemplate>
                    <DataTemplate DataType="{x:Type local:ItemViewModel}">
                        <Ellipse Fill="Blue" Width="12" Height="12" telerik:MapLayer.Location="{Binding Location}"/>
                    </DataTemplate>
                </telerik:VisualizationLayer.ItemTemplate>
            </telerik:VisualizationLayer>

and the ViewModel:

public partial class MainWindowViewModel : ObservableObject
{
    [ObservableProperty] private ObservableCollection<ItemViewModel> _itemViewModels;
    public QueryableCollectionView ItemViewModelsView { get; private set; }
//...
}

It appears to me that the issue is because QueryableCollectionView is both an IEnumerable and a ICollectionView so when it tries to assign it to the MapItemsSource the CollectionViewSource.IsSourceValid() that's called during that assignment is returning false because it is an ICollectionView.

Is there a known workaround for this or suggested alternative to get the expected functionality?

Thanks!

Petar Mladenov
Telerik team
 answered on 26 Mar 2025
0 answers
23 views

RadGridView, for WPF .NET Framework 4.8, automatically hides rows that do not match the filter/search criteria after a row has been edited. How does one prevent the auto-filtering/searching?

A very important workflow for our customers is to search / filter for outliers and then edit the found rows. After they finish editing, they don't want the row to automatically disappear because of the search / filter doesn't match the row after the edits.

The customer only wants to search / filter if they actually initiated the action. They do not want auto searching and filtering.

Stephen
Top achievements
Rank 1
 asked on 24 Mar 2025
1 answer
29 views
Hello everyone!
I am using Telerik in my wpf app(.NET 8.0). There is a RadGridView and the selection mode is multiple. I have a Checkbox(GridViewSelectionColumn) in the first column. And in my model there is a field IsSelectable. now my question is, how can i make the Selection enabled or disabled according to this field? When the IsSelectable is False the whole row should be disabled to select. and vise versa. Here is my current code:
<!--  Main data grid  -->
<telerik:RadGridView
Name="GridView"
Grid.Row="1"
Margin="3"
DataContext="{Binding Requests}"
ItemsSource="{Binding}"
ShowGroupPanel="False"
SelectionMode="Multiple"
SelectionUnit="FullRow"

>
<telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn />

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Id}" Header="{DynamicResource 100314}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Branch}" Header="{DynamicResource 100214}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=OperName}" Header="{DynamicResource 100315}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=OperRefer}" Header="{DynamicResource 100316}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CrtUsr}" Header="{DynamicResource 100317}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CrtDtm}" Header="{DynamicResource 100318}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SndUsr}" Header="{DynamicResource 100319}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SndDtm}" Header="{DynamicResource 100320}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Status}" Header="{DynamicResource 100242}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Remark}" Header="{DynamicResource 100114}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RetCode}" Header="{DynamicResource 100321}" />
</telerik:RadGridView.Columns>

<telerik:EventToCommandBehavior.EventBindings>
<!-- Scroll event (RowLoaded) -->
<telerik:EventBinding
Command="{Binding DataContext.ScrollCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
EventName="RowLoaded"
PassEventArgsToCommand="True"
RaiseOnHandledEvents="True" />
</telerik:EventToCommandBehavior.EventBindings>

</telerik:RadGridView>
Stenly
Telerik team
 answered on 12 Mar 2025
1 answer
25 views

Hi,

I have a radgridview which I have configured to sort using "telerik.RadGridView.SortDescriptors" based on whether a checkbox is tick or untick. However, upon ticking/unticking the checkbox, the radgridview does not sort based on the condition that I have specified. May I ask for the solution for this?

Martin Ivanov
Telerik team
 answered on 11 Mar 2025
1 answer
22 views
Hi all

I have tried all sorts of ways (BindingProxy, Converters, DP Helpers..) but I can't seem to get it to work.

I have this:

  <telerik:GridViewDataColumn
      Header="Unit Cost"
      DataMemberBinding="{Binding UnitCost}"
      Style="{StaticResource Style.GridViewDataColumn.Currency}"
      Width="120" />

And the style (simplified) is this:

<Style
    x:Key="Style.GridViewDataColumn.Currency"
    TargetType="{x:Type telerik:GridViewDataColumn}">
    <Setter
        Property="DataFormatString"
        Value="N2" />

    <!-- Cell Template (Display Mode) -->
    <Setter
        Property="CellTemplate">
        <Setter.Value>
            <DataTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition
                            Width="Auto" />
                        <ColumnDefinition
                            Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock
                        Text="$"
                        VerticalAlignment="Center"
                        Margin="5,0" />
                    <TextBlock
                        Text="{Binding ??, StringFormat=N2}"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Right"
                        Grid.Column="1" />
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>

    <!-- Cell Edit Template -->
    <Setter
        Property="CellEditTemplate">
        <Setter.Value>
            <DataTemplate>
                <telerik:RadMaskedCurrencyInput
                    Value="{Binding Path=??, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    IsTabStop="True" />
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

How can I define the Path generically. If I hard code UnitCost it works, but I need it to be generic, and I can't find a way to do it.

PS: Design breif is that our company wants to display the $ sign on the left and the value aligned right.

Any insight would be welcomed greatly.
Stenly
Telerik team
 answered on 04 Mar 2025
0 answers
21 views

Hello, 

I use the Telerik TreeListView. I would like to implement auto resizing for the header cells. In my app, there is the possibility to change the language. Some of the header texts may be changed by this action.

If a text becomes longer after changing the language (e. g. the German word "Haus" is replaced by the English word "House"), the width of the column gets bigger. That means, auto resizing to a bigger width exists..

But after changing back to German (the header content becomes shorter), there is no auto resizing to a smaller width.

Is there an event I can check or a property for the TreeListView?

Thank you very much.

Best regards,

Alex

Alexander
Top achievements
Rank 1
 asked on 28 Feb 2025
1 answer
29 views

I found out that the ReadOnlyBackgroundBrush from Theme setting is not applied in GridView.

In some grid I have a whole column that should not be edited from the User, while some grid is only editable when the user has the right to do it and some rows are ReadOnly depending on the state of the Row.

Are there theme colors that are dedicated for GridView or is there a generic way to apply a color to GridView and it's cells/rows in ReadOnly state? 

Stenly
Telerik team
 answered on 24 Feb 2025
1 answer
50 views

I need to modify the default scrollbar appearance of the Telerik WPF GridView . Currently, the scrollbar is too wide/thick for my design requirements.

I'm using Telerik UI for WPF with XAML, and despite trying multiple approaches including:

  • Modifying the ScrollViewer style
  • Attempting to override the default template
  • Trying various XAML styling techniques None of these attempts have successfully achieved the desired result.

Specific customization needs:

  • Reduce the width of the scrollbar to make it slimmer
  • Change the color to light grey
  • Add rounded corners to the scrollbar thumb
  • Make the scrollbar background transparent

I'm looking for guidance on how to achieve these styling requirements, either through built-in Telerik properties or custom XAML styling. Since I'm not using any Telerik themes, I need a solution that works with the default styling approach. If anyone has successfully customized the DataGrid scrollbar without themes, I would greatly appreciate a working example.

Current behavior is shown in the attached screenshot where you can see the default thick scrollbar. Any suggestions or solutions would be helpful.
Below is the XAML code that I have been working on

                <telerik:RadGridView 
AutoGenerateColumns="False"
ShowGroupPanel="False"
ItemsSource="{Binding LogEntries}"
RowIndicatorVisibility="Collapsed"
FrozenColumnsSplitterVisibility="Collapsed"
GridLinesVisibility="None"
IsReadOnly="True"
SelectionMode="Single"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
Margin="0,10,0,0"
MaxHeight="350"
Foreground="White"
EnableRowVirtualization="True"
EnableColumnVirtualization="True">

                <telerik:RadGridView.Resources>
                    <Style TargetType="telerik:GridViewCell">
                        <Setter Property="CurrentBorderBrush" Value="Transparent" />
                    </Style>
                    <Style TargetType="telerik:GridViewHeaderCell">
                        <Setter Property="Background" Value="#363736" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="telerik:GridViewHeaderCell">
                                    <Grid>
                                        <Border Background="{TemplateBinding Background}" BorderBrush="#4A4A4A" BorderThickness="0,0,1,1" />
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#363736" />
                                <Setter Property="Foreground" Value="White" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                    <Style TargetType="telerik:GridViewDataColumn">
                        <Setter Property="Background" Value="#FF2C2C2C" />
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#FF2C2C2C" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </telerik:RadGridView.Resources>
                <telerik:RadGridView.RowStyle>
                    <Style TargetType="telerik:GridViewRow">
                        <Setter Property="BorderThickness" Value="0" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                        <Setter Property="Background" Value="Transparent" />
                    </Style>
                </telerik:RadGridView.RowStyle>

                <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn Header="Source" 
                              DataMemberBinding="{Binding Source}"/>
                        <telerik:GridViewDataColumn Header="Timestamp" 
                              DataMemberBinding="{Binding Timestamp}"/>
                        <telerik:GridViewDataColumn Header="user_name" 
                              DataMemberBinding="{Binding user_name}"/>
                        <telerik:GridViewDataColumn Header="event_name" 
                              DataMemberBinding="{Binding event_name}"/>
                        <telerik:GridViewDataColumn Header="file_name" 
                              DataMemberBinding="{Binding file_name}"/>
                        <telerik:GridViewDataColumn Header="Desc" 
                              DataMemberBinding="{Binding Desc}"/>
                        <telerik:GridViewDataColumn Header="process_name" 
                              DataMemberBinding="{Binding process_name}"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

Martin Ivanov
Telerik team
 answered on 17 Feb 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?