I created a class with CommunityToolkit.Mvvm package and use ObservableProperty to create properties for this class. But the PropertyGrid control does not recognize properties created in this way. Are there any way PropertyGrid can support ObservableProperty?
using CommunityToolkit.Mvvm.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Test
{
public partial class DrawingModel : ObservableObject
{
public string Name { get; set; }
[ObservableProperty]
public double _length;
[ObservableProperty]
public double _width;
[ObservableProperty]
public double _height;
}
}
Please see attached image. What could be the cause of this? Some Fonts missing?
I'm using StyleManager for Theming.
Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider provider = new Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider(); RadDocument document = new RadDocument(string myXAMLString); byte[] output = provider.Export(document);
Hi,
i found a sample:
<Window.Resources>
<local:DoubleToDateTimeLabelConverter x:Key="DoubleToDateTimeLabelConverter" />
</Window.Resources>
<Grid>
<telerik:RadCartesianChart>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:LinearAxis>
<telerik:LinearAxis.LabelTemplate>
<DataTemplate>
<TextBlock Text="{Binding StringFormat='h:MM tt', Converter={StaticResource DoubleToDateTimeLabelConverter}}" />
</DataTemplate>
</telerik:LinearAxis.LabelTemplate>
</telerik:LinearAxis>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:CategoricalAxis />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:LineSeries CategoryBinding="City" ValueBinding="StartTimeOA" ItemsSource="{Binding}" />
</telerik:RadCartesianChart>
</Grid>
public MainWindow()
{
InitializeComponent();
var Items = new ObservableCollection<PlotItemViewModel>();
var dateTime = DateTime.Now;
Items.Add(new PlotItemViewModel() { City = "Atlanta", StartTime = dateTime.AddMinutes(5) });
Items.Add(new PlotItemViewModel() { City = "Atlanta", StartTime = dateTime.AddMinutes(10), });
Items.Add(new PlotItemViewModel() { City = "New York", StartTime = dateTime.AddMinutes(100), });
Items.Add(new PlotItemViewModel() { City = "Miami", StartTime = dateTime.AddMinutes(120), });
Items.Add(new PlotItemViewModel() { City = "Miami", StartTime = dateTime.AddMinutes(150), });
Items.Add(new PlotItemViewModel() { City = "Savannah", StartTime = dateTime.AddMinutes(200), });
Items.Add(new PlotItemViewModel() { City = "Birmingham", StartTime = dateTime.AddMinutes(250), });
Items.Add(new PlotItemViewModel() { City = "New Orleans", StartTime = dateTime.AddMinutes(280), });
this.DataContext = Items;
}
}
public class PlotItemViewModel
{
public string City { get; set; }
public DateTime StartTime { get; set; }
public double StartTimeOA { get { return this.StartTime.ToOADate(); } }
}
public class DoubleToDateTimeLabelConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
double doubleValue = double.Parse(value.ToString());
return DateTime.FromOADate(doubleValue);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
The Result is:
Here is the Dateformat "us-US" (10:05 AM / 4:06 PM) but i need German "de-DE" (10:05 / 16:06) !
Have anyone a idea how i can do this?
Best regards
Bernd
myRichTextBox.InsertTable(2,4)
Hello,
I'm trying to remove tab items from RadTabControl where ItemsSource is bound to an ObservableCollection<RadTabItem>. However, when an item is deleted from the collection the tab does not disappear. The desired behavior is for the tab to disappear. What do I need to do to achieve this?
Here's what I have:
xaml declaration:
<telerik:RadTabControl x:Name="radTabControl"
ItemsSource="{ Binding Tabs }"
Padding="0, 0, 0, 0"
Margin="0, 0, 0, 0" >
</telerik:RadTabControl>
Here, I declare Tabs as an observable collection:
public ObservableCollection<RadTabItem> Tabs { get; set; }
Here is where the tab items are deleted:
private void RemoveTab(int dev) { Tabs.Clear(); }
I'm not very familiar with WPF and Telerik in general. Any help would be appreciated.
Thanks.
Hi,
I'm using the CellLoaded event to customize a RadGridView. Setting a background brush and foreground + fontweight for the TextBlock in the cell works as expected. I'm also using the AutoGeneratingColumn event to set a DataTemplate for a column.
Now I want to use DataTemplates for individual cells. But when I do so I have to set a DataTemplate for every cell, every time it's rendered. If I'm not setting a DataTemplate I get a random content from a random cell, everytime a cell is scrolled into view. If I'm using DataTemplates for all cells I can't edit the cells anymore.
Is there anything I can do to stop the RadGridView messing up my cells? Changing the virtualization settings didn't changed anything, even if I disabled virtualization (VirtualizingPanel.IsVirtualizing="False").
This is my GridView now:
<telerik:RadGridView AutoGenerateColumns="True"
VirtualizingPanel.VirtualizationMode="Recycling"
Grid.Row="1"
x:Name="Gv"
Margin="0 20 10 0"
SelectionMode="Extended"
SelectionUnit="Cell"
CellLoaded="GvCellLoaded"
BeginningEdit="GvEditBegins"
CellEditEnded="CellEditEnded"
AutoExpandGroups="True"
GroupRenderMode="Flat"
ValidatesOnDataErrors="None"
telerik:TouchManager.TouchMode="None"
CanUserSortColumns="False"
CanUserSortGroups="False"
IsReadOnly="False"
AllowDrop="True"
ItemsSource="{Binding Items}"
FrozenColumnsSplitterVisibility="Collapsed"
ContextMenuOpening="GvContextMenuOpening"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
PreviewMouseRightButtonDown="GvRightMouseDown"
PreviewMouseLeftButtonDown="GvMouseDown"
PreviewMouseLeftButtonUp="GvMouseUp"
AutoGeneratingColumn="GvAutoGenerate">
I was surprised when I downloaded the latest Q2 release to not find any folder with .NET 8 DLLs, only .NET 7.
NET 7 is already at "End of Support" as of May 14th according to Microsoft.
https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
Considering NET 8 is designated as having LTS (long term support) from Microsoft I was wondering what Telerik's plans are regarding a NET 8 release of your WPF suite?
We would like to move from .NET 6 which we currently use, to .NET 8 which has LTS.