Hi,
I tried to use the RadGridView with an OData Endpoint.
I took a look into the documentations but didn't find any good sample.
I tried it with the QueryableDataProvider.
But my data was not loaded. It always runs into an exception:
Constructing or initializing instances of the type DynamicClass1 with the expression (Param_0 != null) is not supported.
This Exception is thrown by the OData Client.
Below my simplified code:
View:
<Window x:Class="ODataClientTest.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"
xmlns:oDataClientTest="clr-namespace:ODataClientTest"
xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"
d:DataContext="{d:DesignInstance oDataClientTest:MainWindowViewModel}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<pivot:RadPivotGrid Grid.Row="0" Grid.Column="0" DataProvider="{Binding ReportElements}" />
<pivot:RadPivotFieldList Grid.Row="0" Grid.Column="1" DataProvider="{Binding ReportElements}" />
</Grid>
</Window>
ViewModel
using System.Diagnostics;
using Telerik.Pivot.Queryable;
namespace ODataClientTest;
public class MainWindowViewModel : BaseNotifyPropertyChanged
{
public MainWindowViewModel()
{
MyOdataContext dataContext = new();
ReportElements = new()
{
Source = dataContext.ReportElements,
DeferUpdates = true
};
ReportElements.StatusChanged += (sender, args) =>
{
if (args.Error != default)
Debugger.Break(); // Here I can see the exception
};
}
public QueryableDataProvider ReportElements
{
get => GetValue<QueryableDataProvider>();
set => SetValue(value);
}
}
My Question now: Is there any way to connect my OData Source to a PivotGrid?
Unfortunalety I could not use the LocalDataProvider, as the OData API returns a lot of data which must be filtered beforehand.
I also tried to use the normal GridView with works perfectly with the QueryableDataServiceCollectionView. But: It does not fit our needs, like Grouping, Creating dynamic aggregates (sum, average, etc.).
We are currently using .Net 4.7.2.
Many thanks!
Hello.
I'm looking for a similar control like Matrix table.
Among them, HeatMap Control is the most similar, so I used it.
But here is the problem. I have attached an example file.
I want to control by putting TextBox in Cell. However, putting a textbox in the template doesn't work.
I'm far from using HeatMap, but I'm trying to use it this way.
Is there a way or could you recommend a different control for what I want to do?
Thanks.