Hi. I'm trying to asynchronously load data in a ViewModel when the ViewModel is created. Today I am using Catel in my application for MVVM functionality. If the Control is of type Catel.UserControl then an overridden method InitializeAsync is automatically called when the control loads allowing me to async load data.
However, I am migrating this application to use Telerik Docking. For docking to work I need the controls to be of type RadPane or RadDocumentPane. Making this modification breaks Catel's InitializeAsync functionality. So I'm left searching for the best way to asynchronously load data in aTelerik RadPane/RadDocumentPane.
I might have found a working solution, but I wanted to check if there's a better way to do this. The solution I found is to add an interaction trigger that fires an async command on the RadPanes 'Loaded' event. https://newbedev.com/calling-async-method-to-load-data-in-constructor-of-viewmodel-has-a-warning.
Edit: I should note that I'm using the Telerik DockingPrism7 sample.
Current XAML with Catel:
<catel:UserControl xmlns:catel="http://schemas.catelproject.com">
<Grid>
<telerik:RadGridView ItemsSource="{Binding Model}" />
</Grid>
</catel:UserControl>
ViewModel:
public class ObjectViewModel : Catel.MVVM.ViewModelBase
{
/// <summary>
/// Create model and get all tenants.
/// </summary>
/// <param name="tenantBL"></param>
/// <param name="security"></param>
public ObjectViewModel(BL bl) : base()
{
}
/// <summary>
/// Initialize control. Automatically called if Control is of type Catel.UserControl.
/// </summary>
/// <returns>Task</returns>
protected override async Task InitializeAsync()
{
await base.InitializeAsync();
await LoadDataFromBL();
}
/// <summary>
/// Load all data from the business logic.
/// </summary>
/// <returns>Task</returns>
private async Task LoadDataFromBL()
{
await DoSomething();
}
}Hi Guys,
When i set the chartview, the RadLegend didn't show normally..
I have uploaded my solution.
Best wishes,
JIJIKO
Hello.
this is version 2020.1
I have a scheduler working nicely (lots of customizations...)
Now, I am trying to edit an appointment calling RadScheduleViewCommands.EditAppointment.Execute:
public void EditAppointmentWithDialog(AppointmentDTO appointmentData)
{
var appo = PersistenceLayer.FindAppointment(appointmentData.ID);
ScheduleView.scheduleView.CurrentDate = appo.AppointmentDate;
var newAppo = Appointments.FirstOrDefault(app => app.ID == appointmentData.ID);
ScheduleView.scheduleView.SelectedAppointment = newAppo;
RadScheduleViewCommands.EditAppointment.Execute(null, ScheduleView.scheduleView);
}void IEditableObject.BeginEdit is called, so everything is in place.
If I cancel the edit, everything goes fine.
If I just click Ok in the edit window, void IEditableObject.EndEdit is never called.
I get a null exception error and the program exits.
See the attached file for the exception log.
Thanks!
Hi,
I have a GridView bound to a DataTable. The DataTable contains a combinition of numeric and non numeric columns. Null is a valid value in the the numeric columns. How do I let the user clear an existing numeric value to null?
/Brian
Solved.
I was wondering how I can create a new Aggregation Function and add it to this list of existing Functions in "More Aggregation Options"
In this article I see that they managed to create the 'Sqrt Of Sum' function in WinForms
-> https://docs.telerik.com/devtools/winforms/controls/pivotgrid/custom-aggregation
I would like to know how I can be doing the same to add an Aggregation Function in Options in PivotGrid WPF:
Explanatory Image below:
Thank you!
Hi there,
I'm running into an issue with the RadMultiColumnComboBox where after opening up a context menu, the dropdown loses the ability to dismiss itself when you click away from the grid, despite KeepDropDownOpen still being false.
The easiest way to repro is by using the RadContextMenu and RadGridView MVVM SDK example, except with this modification to the grid at the bottom of Example.xaml:
<Grid>
<telerik:RadMultiColumnComboBox KeepDropDownOpen="False">
<telerik:RadMultiColumnComboBox.ItemsSourceProvider>
<telerik:GridViewItemsSourceProvider ItemsSource="{Binding Items}"/>
</telerik:RadMultiColumnComboBox.ItemsSourceProvider>
</telerik:RadMultiColumnComboBox>
</Grid>After opening the context menu inside the grid's header, the popup can't be closed by clicking in the main window and must be closed by clicking the dropdown button.
I've seen some very old threads regarding similar use cases and those coming back as unsupported but this felt like a natural enough extension of the example case that I wanted to see if this was a bug or not. If it's unsupported, are there any ideas for a workaround?
Thanks,
Matthew
I'm using Implicit Styles with the NoXaml dlls (Office_Black) theme to change the look of the RadMaskedDateTimeInput.
I'd like to know how to set the BorderBrush of the control when hovering the mouse.
Thank you
Hi, guys.
I bind style to BarSeries, here is the code.
<Style TargetType="{x:Type telerik:BarSeries}">
<Setter Property="ShowLabels" Value="True"/>
<Setter Property="TooltipTemplate">
<Setter.Value>
<DataTemplate>
<Border Background="{DynamicResource BrightColor}" Padding="6" TextElement.Foreground="White">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Y=" FontWeight="Bold" />
<TextBlock Text="{Binding YValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="X=" FontWeight="Bold" />
<TextBlock Text="{Binding XValue}" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>