iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Trying to get the UXQueryBuilder functional in a small WPF project, but after hitting the dropdown(s) to select a property, receive an exception "Object Reference Not Set to an Instance of the Object". I know, something stupid I'm doing, but I can't seem to track down the missing piece in the configuration.
Binding Errors from the output window:
System.Windows.Data Information: 41 : BindingExpression path error: 'Name' property not found for 'object' because data item is null. This could happen because the data provider has not produced any data yet. BindingExpression:Path=Name; DataItem=null; target element is 'ContentControl' (Name=''); target property is 'Content' (type 'Object') System.Windows.Data Information: 20 : BindingExpression cannot retrieve value due to missing information. BindingExpression:Path=Name; DataItem=null; target element is 'ContentControl' (Name=''); target property is 'Content' (type 'Object') System.Windows.Data Information: 21 : BindingExpression cannot retrieve value from null data item. This could happen when binding is detached or when binding to a Nullable type that has no value. BindingExpression:Path=Name; DataItem=null; target element is 'ContentControl' (Name=''); target property is 'Content' (type 'Object') System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=Name; DataItem=null; target element is 'ContentControl' (Name=''); target property is 'Content' (type 'Object')
Overview:WPF 'Client' Application loading OData from an asp.net web site with a WCF Service (EF5, .nET 4.5, C#)
<Intersoft:UXQueryBuilder x:Name="QryBuilder" CollectionView="{Binding People}" Intersoft:DockPanel.IsFillElement="True" ObjectType="{Binding ObjectType}" PropertyListMode="All" QueryOperation="Client" />
Here is the UXGridView that is using the same underlying PagedCollectionView to display the data, everything works fine here.
<Intersoft:UXGridView AutoGenerateColumns="False" EnableRowVirtualization="True" QueryOperation="CLient" SortDescriptors="{Binding People.SortDescriptors,Mode=TwoWay}" ItemsSource="{Binding People,Mode=TwoWay}" SelectedItem="{Binding SelectedPerson,Mode=TwoWay}">
Behind the scens in the ViewModel
public Type ObjectType
{get { return typeof(LwCiPerson); }}
<model constructor... excerpt>
_lstPeople = new ObservableCollection<LwCiPerson>(); People = new PagedCollectionView(LstPeople); _people.SortDescriptions.Add(new SortDescription("NameLast",ListSortDirection.Ascending)); _people.SortDescriptions.Add(new SortDescription("NameFirst", ListSortDirection.Ascending)); _people.FilterDescriptions.Add(new FilterDescription { PropertyName = "Modified", Value = DateTime.Today, Operator = FilterOperator.IsLessThanOrEqualTo }); _people.FilterDescriptions.Add(new FilterDescription { PropertyName = "Modified", Value = DateTime.Today.AddDays(-30), Operator = FilterOperator.IsGreaterThanOrEqualTo }); <end model constructor excerpt>
The samples are simple enough, and reading through the client documentation, I don't really see anything that jumps out and says "doh, you missed this"
Anyone have any thoughts on what I'm overlooking here? This is just a small data browsing tool I'm developing to review some data in technical support situations, so it's not mission critical. I have an existing way to filter the data that is quite a bit more limited, but wanted to see if I could accomplish the same functionality using UXQueryBuilder as it is a lot more functional, and intuitive. This, in conjunction with a UXPropertyGrid, makes data review at a client site wonderfully simple when you don't have access to SQL Mgmt Studio and are investigating an issue.
Thanks for any help!
-Patrick
Could you please ensure whether the LwCiPerson object has NameLast and NameFirst property? This error message is quite odd since it says that: “This could happen because the data provider has not produced any data yet”.
Definitely has those properties, in fact I have a UXGridView on the screen that is displaying all of the data from the PagedCollectionView that the UXQueryBuilder is tied to, and it's working without issues.
Sorry for the delay in sending this.
I created a simple sample of UXQueryBuilder based on your description. It’s a WPF application which gets data from WCF Service. However, I was unable to reproduce the reported problem, exception persist after hitting the dropdown(s) to select a property.
Please have the attached sample evaluated on your end and let me know whether it helps or not.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname