Telerik Forums
UI for WPF Forum
1 answer
3.0K+ views

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();
    }
}

Dilyan Traykov
Telerik team
 answered on 09 Dec 2021
1 answer
118 views

Hi Guys,

When i set the chartview, the RadLegend didn't show normally..

I have uploaded my solution.

Best wishes,

JIJIKO

Stenly
Telerik team
 answered on 08 Dec 2021
2 answers
119 views

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!

Richard
Top achievements
Rank 1
Iron
 answered on 08 Dec 2021
1 answer
330 views

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

Stenly
Telerik team
 answered on 07 Dec 2021
0 answers
108 views

Solved.

JIJIKO
Top achievements
Rank 1
Iron
 updated question on 06 Dec 2021
1 answer
220 views

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!

Dilyan Traykov
Telerik team
 answered on 06 Dec 2021
1 answer
170 views
Good morning people, I'm having problems trying to create a new Calculated Field or a new Aggregate Function.

I need to add a weighted average function with the values ​​using the last column of the PivotGrid as the weight.

I happen to make the examples from the documentation and even so, the examples don't even work, the Calculates in the component are not added. Is there another way to do this?
Dilyan Traykov
Telerik team
 answered on 06 Dec 2021
1 answer
237 views

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

Stenly
Telerik team
 answered on 03 Dec 2021
1 answer
158 views

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

 

 
Stenly
Telerik team
 answered on 03 Dec 2021
1 answer
126 views

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>
but ToolTip didn't show any data.
Martin Ivanov
Telerik team
 answered on 03 Dec 2021
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?