Hi,
I'm trying to debug the salesdashboard source and receive the following error? Not sure how to resolve, can someone help please?
System.Data.Services.Client.DataServiceQueryException
HResult=0x80131509
Message=An error occurred while processing this request.
Source=Microsoft.Data.Services.Client
StackTrace:
at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)
at SalesDashboard.MainRepository.<>c__DisplayClass22_1.<GetDailyActualsVsTargetsByProduct>b__1() in C:\Users\robertf\Downloads\SalesDashboard_WPF_Dev_2023_3_1114_SourceCode\SalesDashboard\ViewModel\MainRepository.cs:line 126
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
DataServiceClientException: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="en-US">An error occurred while processing this request.</message>
</error>
I'm looking for a NuGet Package that contains the Telerik.Windows.Controls.DataServices library that is binded against the latest Microsoft.OData.Client library.
In your documentation (https://docs.telerik.com/devtools/wpf/controls/raddataservicedatasource/getting-started/getting-started) you write, that such a version can be found in the NetCore, WPF50 and WPF60 folders. But in none of the NuGet packages I'm able to find such a folder.
I would highly appreciate it if you can help out here.
I have downloaded the Telerik provided example Telerik xaml-sdk\DataServiceDataSource to investigate using the Telerik RadGridView and its pagination behaviors against an OData webservice. For the most part this is working as I expected however I have one other requirement.
I have provided a screenshot of some functionality that allows a user to build their own custom subset of the information displayed by moving rows from the original source to another separate list however when a record is removed from the DataServiceSource the pagination is disabled as it detects that a change is present.
I need the DataServiceSource to be bound to the grid so that the filtering and paging works against the OData API as intended but this precludes me from getting the list building to work.
Is there a way we can disable this internal change tracking or is there some other components we could use?
Hello,
Here is my situation:
1. I have got client app in WPF ( Cant create here any db context etc )
2. I have got Rest Api where is DbContext (EntityFramework)
3. I have got RadGrid and RadPager
I want to pass QueryableCollectionView or QueryableEntityCollectionView or something else? to this rest api, processing data, use filters, pagination and sorters from radgrid. Then in returns i want to receive collection of Products, Employees or something
Is any body do something like this? I know that in Blazor UI there is DataSourceRequest etc and it works fine, but i did not find alternative in WPF
I have referred to example solutions and projects provided by Progress/Telerik.
I have a sample WPF application which refers to the Csharp.ReportLibrary project, and under Csharp.ReportLibrary I have added a Folder which contains .cs component design file(CardSummary.cs in below image). This design file is the ui of my report.
The question is , is it possible to bind this component with a object data source at run time? where the object can be of any user defined type?
Currently by right clicking the object datasource icon and changing properties of DataMember and DataSource, I am only able to bind it to a method within a class file which returns list. (CardSummaryActivity.cs is the class as shown in below image)
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!
[DataServiceKey(
"FactTradeHeaderIdentifier"
)]
public
class
TradeHeaderModel
{
[Key]
[DataMember(IsRequired =
true
)]
public
int
FactTradeHeaderIdentifier {
get
;
set
; }
...
}
/// <summary>
/// There are no comments for Edft.Regulatory.Tracker.Service.Web.ApiModels.TradeHeaderModel in the schema.
/// </summary>
/// <KeyProperties>
/// FactTradeHeaderIdentifier
/// </KeyProperties>
[global::System.Data.Services.Common.EntitySetAttribute(
"TradeHeaders"
)]
[global::System.Data.Services.Common.DataServiceKeyAttribute(
"FactTradeHeaderIdentifier"
)]
public
partial
class
TradeHeaderModel : global::System.ComponentModel.INotifyPropertyChanged
{
/// <summary>
/// There are no comments for Property FactTradeHeaderIdentifier in the schema.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(
"System.Data.Services.Design"
,
"1.0.0"
)]
public
int
FactTradeHeaderIdentifier
{
get
{
return
this
._FactTradeHeaderIdentifier;
}
set
{
this
.OnFactTradeHeaderIdentifierChanging(value);
this
._FactTradeHeaderIdentifier = value;
this
.OnFactTradeHeaderIdentifierChanged();
this
.OnPropertyChanged(
"FactTradeHeaderIdentifier"
);
}
}
...
}
var ds =
new
QueryableDataServiceCollectionView<TradeHeaderModel>(apiService.Container, apiService.Container.TradeHeaders);
hello ,
Asp web api OdataController created against Microsoft.Aspnet.Odata v 7.1.0 which uses the new odata schema (Edmx not Edm) for the model
and the Odata Client Code Generator template for c# creates the proxy class agains Microsoft.OData.Client v 7.5.1
and the RadDataServiceDataSource is built against the Microsoft.OData.Client v 6.15.0 as stated in the docs
and if we use this version to load the edmx file we got error as it is expecting a different root element in the model file
so is there a work around for this issue ? am i missing something ?
thank you so much
Hi.
I'm considering the purchase of UI for WPF, so I downloaded to test the trial version.
I'm working through this example (http://docs.telerik.com/devtools/wpf/controls/raddataservicedatasource/getting-started/creating-the-data-bound-controls), but instead of WCF services, I'm using OData version 7.
Everything works fine, except when I'm trying to apply even a single filter on columns containing enum elements, I'm getting this exception :
Babken Gevorgyan, [01.08.17 13:36]
System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=IsActive; DataItem='DistinctValueViewModel' (HashCode=2921675); target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1') NotSupportedException:'System.NotSupportedException: Could not convert constant Credit expression to string.
at Microsoft.OData.Client.ExpressionWriter.VisitConstant(ConstantExpression c)
at Microsoft.OData.Client.ALinqExpressionVisitor.Visit(Expression exp)
at Microsoft.OData.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at Microsoft.OData.Client.ExpressionWriter.Visit(Expression exp)
at Microsoft.OData.Client.ExpressionWriter.VisitOperand(Expression e, Nullable`1 parentType, Nullable`1 childDirection)
at Microsoft.OData.Client.ExpressionWriter.VisitBinary(BinaryExpression b)
at Microsoft.OData.Client.ALinqExpressionVisitor.Visit(Expression exp)
at Microsoft.OData.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at Microsoft.OData.Client.ExpressionWriter.Visit(Expression exp)
at Microsoft.OData.Client.ExpressionWriter.ExpressionToString(DataServiceContext context, Expression e, Boolean inPath, Version& uriVersion)
at Microsoft.OData.Client.UriWriter.VisitQueryOptionExpression(FilterQueryOptionExpression fqoe)
at Microsoft.OData.Client.UriWriter.VisitQueryOptions(ResourceExpression re)
at Microsoft.OData.Client.UriWriter.VisitQueryableResourceExpression(QueryableResourceExpression rse)
at Microsoft.OData.Client.DataServiceALinqExpressionVisitor.Visit(Expression exp)
at Microsoft.OData.Client.UriWriter.Translate(DataServiceContext context, Boolean addTrailingParens, Expression e, Uri& uri, Version& version)
at Microsoft.OData.Client.DataServiceQueryProvider.Translate(Expression e)
at Microsoft.OData.Client.DataServiceQuery`1.get_RequestUri()
at Telerik.Windows.Data.QueryableDataServiceCollectionView`1.ReturnsSingleEntity(DataServiceQuery`1 query)
at Telerik.Windows.Data.QueryableDataServiceCollectionView`1.BuildDataServiceQuery(Int32 pageIndex)
at Telerik.Windows.Controls.DataServices.QueryableDataServiceCollectionViewBase.CompletePageMove(Int32 newPageIndex)
at Telerik.Windows.Data.QueryableCollectionView.MoveToPageCore(Int32 index)
at Telerik.Windows.Controls.DataServices.QueryableDataServiceCollectionViewBase.MoveToPageCore(Int32 index)
at Telerik.Windows.Data.QueryableCollectionView.InvalidatePaging()
at Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsChanged()
at Telerik.Windows.Data.QueryableDataServiceCollectionView`1.OnFilterDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
at Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Insert(Int32 index, Object value)
at Telerik.Windows.Data.CollectionHelper.Insert(IList target, IEnumerable newItems, Int32 startingIndex, IEqualityComparer itemComparer)
at Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
Babken Gevorgyan, [01.08.17 13:36]
at Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
at Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Telerik.Windows.Controls.GridViewColumn.OnColumnFilterDescriptorPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Telerik.Windows.Data.DescriptorBase.OnPropertyChanged(PropertyChangedEventArgs args)
at Telerik.Windows.Data.DescriptorBase.OnPropertyChanged(String propertyName)
at Telerik.Windows.Data.DescriptorBase.ResumeNotifications()
at Telerik.Windows.Controls.GridView.FilteringViewModel.ApplyFilters()
at Telerik.Windows.Controls.GridView.FilteringViewModel.OnDistinctValuesChanged()
at Telerik.Windows.Controls.GridView.FilteringViewModel.OnDistinctValuesItemChanged(Object sender, ItemChangedEventArgs`1 e)
at Telerik.Windows.Data.ObservableItemCollection`1.RaiseGenericItemChanged(ItemChangedEventArgs`1 e)
at Telerik.Windows.Data.ObservableItemCollection`1.OnItemChanged(ItemChangedEventArgs`1 e)
at Telerik.Windows.Data.ObservableItemCollection`1.Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent(Object sender, PropertyChangedEventArgs args)
at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
at Telerik.Windows.Controls.ViewModelBase.OnPropertyChanged(String propertyName)
at Telerik.Windows.Controls.GridView.DistinctValueViewModel.set_IsActive(Boolean value)'
Thanks.