Is this the best place to report bugs?
This is with 2024.4.1213.462.
To duplicate the issue:
Expect the following exception to be raised
Name | Value | Type | |
---|---|---|---|
◢ | $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>
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
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.
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
Hello,
How can I change the header button text color and the week number text color (see attachment)?
Kind regards
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.
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.Controls, Telerik.Windows.Controls.Input, Telerik.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>
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?
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.