Telerik Forums
UI for WPF Forum
1 answer
4 views

Is this the best place to report bugs?

This is with 2024.4.1213.462.

To duplicate the issue:

  1. With VS 2022, create a WPF (.NET Framework) application,
  2. Delete MainWindow.xaml and MainWindow.xaml.cs
  3. Unzip the attached file, place MainWindow.xaml and MainWindow.xaml.cs from the zip where the old files were or use the pasted text below
  4. Build and run the application
  5. Put focus on a cell in a row in the grid and type a letter

Expect the following exception to be raised

NameValueType
$exception{"Object reference not set to an instance of an object."}System.NullReferenceException

at Telerik.Windows.Controls.DateTimePickerGridViewEditor.Telerik.Windows.Controls.GridView.IGridViewEditor.SetText(String text) in Telerik.Windows.Controls\DateTimePickerGridViewEditor.cs:line 56

 

In case the zip doesn't work:

MainWindow.xaml.cs:

namespace WpfApp14
{
    using System;
    using System.ComponentModel;
    using System.Windows;
    using System.Collections.ObjectModel;

    public sealed class GridValueViewModel : INotifyPropertyChanged
    {
        private string someValue = string.Empty;

        public GridValueViewModel(string someValue)
        {
            this.SomeValue = someValue;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public string SomeValue
        {
            get
            {
                return this.someValue;
            }

            set
            {
                value = value ?? string.Empty;
                if (this.SomeValue != value)
                {
                    this.someValue = value;
                    this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.SomeValue)));
                }
            }
        }

        public DateTime? DateValue
        {
            get
            {
                if (DateTime.TryParse(this.SomeValue, out var value))
                {
                    return value;
                }

                return null;
            }

            set
            {
                if (value == null)
                {
                    this.SomeValue = string.Empty;
                    return;
                }

                this.SomeValue = value.ToString();
            }
        }

        public ObservableCollection<string> SomeValueItems { get; } = new ObservableCollection<string>(
            new[]
            {
                "cat",
                "dog",
                "bird"
            });
        
    }

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            this.DataContext = this;
        }

        public ObservableCollection<GridValueViewModel> Values { get; } = new ObservableCollection<GridValueViewModel>(
            new[]
            {
                new GridValueViewModel("cat"),
                new GridValueViewModel("dog"),
                new GridValueViewModel("bird")
            });
    }
}

 

MainWindow.xaml:

<Window x:Class="WpfApp14.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <telerik:RadGridView
        AutoGenerateColumns="False"
        ItemsSource="{Binding Values, Mode=OneWay}">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn
                Header="Column 1">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <Label
                            Content="{Binding SomeValue}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
                <telerik:GridViewDataColumn.CellEditTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition
                                    Width="*" />
                            </Grid.ColumnDefinitions>
                            <TextBox
                                Grid.Column="0"
                                Text="{Binding SomeValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                Visibility="Collapsed" />
                            <telerik:RadComboBox
                                Grid.Column="0"
                                HorizontalAlignment="Stretch"
                                IsEditable="False"
                                ItemsSource="{Binding SomeValueItems}"
                                SelectedItem="{Binding SomeValue}" />
                            <telerik:RadDateTimePicker
                                Grid.Column="0"
                                HorizontalAlignment="Stretch"
                                InputMode="DatePicker"
                                DateTimeWatermarkContent="{x:Null}"
                                SelectedValue="{Binding DateValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                Visibility="Collapsed" />
                        </Grid>
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellEditTemplate>
            </telerik:GridViewDataColumn>
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
</Window>

Stenly
Telerik team
 answered on 07 Aug 2025
1 answer
16 views

I using the <telerik:RadDatePicker> 

 DisplayFormat = (Long or short) only there I need a customer format how we archive.

 

Example : 1 July 2025, 1 JUL 2025

Stenly
Telerik team
 answered on 14 Jul 2025
0 answers
14 views

I've been trying to remove the thin white border line with no luck,  Any help?


                            <telerik:RadGridView
                                Margin="0,5,0,0" AutoGenerateColumns="False" BorderThickness="0" BorderBrush="{StaticResource LaGrey12}"
                                ColumnBackground="{StaticResource LaGrey12}"
                                GridLinesVisibility="None" IsReadOnly="True"
                                ItemsSource="{Binding ContactActivityNote.ContactActivityParticipants}"
                                ShowColumnHeaders="False">
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn
                                        Width="Auto"
                                        DataMemberBinding="{Binding ParticipationTypeId}"
                                        Header="Type" />
                                    <telerik:GridViewDataColumn
                                        Width="*"
                                        DataMemberBinding="{Binding AddressedTo}"
                                        Header="Addressed To" />
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>

Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
 asked on 07 Jul 2025
0 answers
15 views

I have a RadGridview displaying data from a datatable using autogenerated columns. I have EnableColumnVirtualization="True" and EnableRowVirtualization="True". When I scroll through the grid, columns and rows are autosizing to display data and everything looks good for the most part.

However, I have some columns that can be excessively wide, easily twice the width of the screen. The same for rows, I occasionally have a cell where the row is excessively high.

How can I set a max width for column and row to prevent excessively wide columns or tall rows? I tried setting MaxHeight and MaxWidth, but that also constrains the user to those settings if they do intentionally want to increase those values.

Clint
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 30 Jun 2025
1 answer
23 views
I currently have a function grid similar to:



<telerik:RadGridView Grid.Row="2" Grid.ColumnSpan="2" x:Name="MyGridView"
                     ItemsSource="{Binding MyItems}"
                     RowIndicatorVisibility="Collapsed"
                     ShowColumnFooters="True"
                     ShowGroupPanel="False"
                     IsReadOnly="True"
                     HorizontalContentAlignment="Stretch"
                     VerticalAlignment="Top">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding MonthDisplay}" Header="Month" Width="65">
            <telerik:GridViewDataColumn.Footer>
                <TextBlock Text="Totals:"/>
            </telerik:GridViewDataColumn.Footer>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Column1Data}" Header="Column 1" Width="*" MinWidth="40" MaxWidth="95" DataFormatString="#,###0.##" TextAlignment="Right" FooterTextAlignment="Right">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction/>
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Column2Data}" Header="Column 2" Width="*" MinWidth="40" MaxWidth="95" DataFormatString="#,###0.##" TextAlignment="Right" FooterTextAlignment="Right">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction/>
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Column3Data}" Header="Column 3" Width="*" MinWidth="40" MaxWidth="95" DataFormatString="#,###0.##" TextAlignment="Right" FooterTextAlignment="Right">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction/>
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Column4Data}" Header="Column 4" Width="*" MinWidth="40" MaxWidth="95" DataFormatString="#,###0.##" TextAlignment="Right" FooterTextAlignment="Right">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction/>
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

So the grid would show results like:


Month	Column1	Column2	Column3	Column4
Jan	1	2	3	4
Feb	1	2	3	4
March	1	2	3	4
Totals:	3	6	9	12


What I now want to do is add another footer row so that the grid would look like:

Month	Column1	Column2	Column3	Column4
Jan	1	2	3	4
Feb	1	2	3	4
March	1	2	3	4
Totals:	3	6	9	12
Average:1	2	3	4
Is it possible to add a 2nd footer row and  if so how can I accomplish that?
Martin Ivanov
Telerik team
 answered on 26 May 2025
0 answers
16 views

Hi,

  I have rad grid view with Grouping along with Select checkbox (GridviewCheckboxcolum). I need below help

  1. I need to know how we can achieve Select all functionality on Grid as well ex: If i select check box column in header it has to select all the rad Gridview groups as well
  2. I also need to know how can achieve group filtering as well
  3. How we can achieve sorting with Group Names?

Thanks in advance

 

 

Jaypalsinh
Top achievements
Rank 1
 asked on 22 May 2025
2 answers
61 views

Hello everybody,

in my WPF Application I am using Telerik's RadGridView. Everything is working fine so far.

But there is a little design issue, I am facing with.

In my App I am using Windows11Theme, if I use this, every row in my GridView is starting with a blue column. Sadly I am not able to find out, how to change this color.

Previously, I was using Windows8Theme and there I used "StrongColor" property to change this color. But I am not able to find out, how to change it in Windows11Theme.

Attached is an image, which shows the row, I want to change.

Thanks for your support.

BR,

Alex

Alexander
Top achievements
Rank 1
Iron
 answered on 06 May 2025
1 answer
36 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
48 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
34 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?