Telerik Forums
UI for WPF Forum
1 answer
19 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
Is there a way to use RadMaskedDateTimeInput with RadDateTimePicker?  Users want to be able dates in MM/dd/yyyy format (without typing the slashes) or use the calendar picker.  I believe RadDateTimePicker uses RadWatermarkTextBox which does not have tight input control.
Martin Ivanov
Telerik team
 answered on 29 Jul 2025
1 answer
32 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
1 answer
85 views

I am using DateTimePicker on WPF and I would like to know if there is a way to modify the bacjgroud color of the DateTimePicker for a couple of dates.

 

Thank you in advance.

Stenly
Telerik team
 answered on 16 Sep 2024
0 answers
58 views

Hi!  I am seeking assistance with this column in WPF, in a RadGridView:

<telerik:GridViewDataColumn DataMemberBinding="{Binding TargetDateET, StringFormat={}{0:MM/dd HH:mm}}" Header="Target Date" />

It displays DateTime values in the grid in the following format: "MM/dd HH:mm"

The issue is that the FilterDescriptor is in this format: "MM/dd/yyyy HH:mm:ss tt"

And when the filters are saved and presented to the user, they are different.



What I can do to manage this data in the same format? (Without having to generate a new variable that is a string and that returns the correct format) Help! Thanks in advance! Juan

Pablo
Top achievements
Rank 1
 updated question on 03 Jul 2024
1 answer
164 views

Hello,

How can I change the header button text color and the week number text color (see attachment)?

Kind regards

 

Stenly
Telerik team
 answered on 18 Mar 2024
1 answer
138 views

Hi


I use the RadDateTimePicker and have a button ("Next"):

When now the user changes the date/time value to an invalid date/time an error is shown:

When the user clicks on the "Next" button the DateTimeText disapears and is empty and an error is schown:

My Question:
Is it possible to set the DateTimeText to the previous wrong formatted date/time (120000000000.07.23 08:49) like this ? 

I have tried to overload the method  OnParseDateTime and set the CurrentDateTimeText but it's not working.

Dinko
Telerik team
 answered on 13 Jul 2023
0 answers
238 views

Hi. 

I've tried to use RadDateTimePicker inside RadGridView, but datepicket is not showing (examle from: WPF DateTimePicker - How to use RadDateTimePicker in a Grid - Telerik UI for WPF).  Tried to add control outside grid but without any effect. 

Project is referenced to Telerik.Windows.Data.dll, Telerik.Windows.ControlsTelerik.Windows.Controls.InputTelerik.Windows.Controls.GridView...


<Window x:Class="Test"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"         
        Title="Test" Height="450" Width="800">
    <Grid>
    
        <telerik:RadDateTimePicker                                 
                                InputMode="DatePicker"
                                telerik:DropDownButtonExtensions.FocusContentOnOpen="True"                              
                                SelectedValue="{Binding Established, Mode=TwoWay}"/>
        
        <telerik:RadGridView Name="radGridView" 
                     AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Name" 
                                    DataMemberBinding="{Binding Name}" />
                <telerik:GridViewDataColumn Header="Established" 
                                    DataMemberBinding="{Binding Established}">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadDateTimePicker                                 
                                InputMode="DatePicker"
                                telerik:DropDownButtonExtensions.FocusContentOnOpen="True"
                              
                                SelectedValue="{Binding Established, Mode=TwoWay}"/>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Stadium" 
                                    DataMemberBinding="{Binding StadiumCapacity}" 
                                    DataFormatString="{}{0:N0}" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

Michał
Top achievements
Rank 1
 asked on 06 Apr 2023
0 answers
204 views

Hello, 

I created a new template for the RadDateTimePicker because I overrided the Clock Part.

As part of the changes I added a Tooltip which shows the date time if not null. In the Watermark control part of the template I show the SelectedValue property that is bound to the ViewModel - TwoWayBinding. The string format of the DateTime is full date: dd/MM/yyyy with full time: HH:mm:ss. So I see the parsed Text on the control. 

I can't find an easy way to show the tooltip in the same format as the display date. I can't set the Tooltio content to RelativeSource Path=SelectedValue because it shows the DateTime in orginal format.

I also can't show in the Tooltio the DisplatText because even if binding OneWay, the date is flickering in every change like binding is wrong.

In the Style of the RadDateTimePicker I have access to SelectedValue, SelectedDateTime,SelectedTime properties but it seems that you convert the Date Time to a text inside the control code because it doesn't work on the Tooltip.

 

Do you have any solution for that?

alex
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 08 Feb 2023
1 answer
118 views

Hello:

About the RadDateTimePicker,

when I set the telerik:ValidationErrorTemplateHelper.ShowWhenFocused = "True"

It only doesn't work on Theme="Expression_Dark".

The others themes seems no problem.

Masha
Telerik team
 answered on 08 Dec 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?