This question is locked. New answers and comments are not allowed.
Hi!
There is the RadDDS and the RadGridView in the xaml:
I need to change the query to query+parameters in my code-behind. I do it this way:
That's work.
But when I try to change it back:
I have got an error in the 4th line:
"System.NullReferenceException in Telerik.Windows.Controls.RadDomainDataSource.PrepareParameterValue(ParameterInfo serverParameter)".
I have tried to swap the 3rd and 4th lines. It has been useless.
Attempt to reinitialize property QueryParameters
no results, cause "Cannot change read-only DependencyProperty".
How can I clear or reset this property or change Query+Parameters to Query?
There is the RadDDS and the RadGridView in the xaml:
<telerik:RadDomainDataSource x:Name="RadSource" DomainContext="{Binding Path=context}" QueryName="GetPersonSetQuery" AutoLoad="True" /><telerik:RadGridView x:Name="RadGV" ItemsSource="{Binding ElementName=RadSource, Path=DataView}" AutoGenerateColumns="True"/>I need to change the query to query+parameters in my code-behind. I do it this way:
using swd = System.Windows.Data;using twc = Telerik.Windows.Controls;RadSource.AutoLoad = false;RadSource.DomainContext = null;RadSource.QueryName = "GetPersonSetByDepartmentId";RadSource.QueryParameters.Add(/*here create new parameter*/);RadSource.SetBinding(twc.RadDomainDataSource.DomainContextProperty, new swd.Binding(){ Path = new swd.PropertyPath("context") } );RadSource.AutoLoad = true;RadSource.Load();But when I try to change it back:
1 RadSource.AutoLoad = false;2 RadSource.DomainContext = null;3 RadSource.QueryName = "GetPersonSetQuery";4 RadSource.QueryParameters.Clear();5 RadSource.SetBinding(/*...*/);6 RadSource.AutoLoad = true;7 RadSource.Load();"System.NullReferenceException in Telerik.Windows.Controls.RadDomainDataSource.PrepareParameterValue(ParameterInfo serverParameter)".
I have tried to swap the 3rd and 4th lines. It has been useless.
Attempt to reinitialize property QueryParameters
RadSource.SetValue(RadDomainDataSource.QueryParametersProperty,new QueryParameterCollection());How can I clear or reset this property or change Query+Parameters to Query?