RadSplitContainer splitContainer =
new
RadSplitContainer();
WebBrowser browser =
new
WebBrowser();
browser.Navigate(
"http://www.facebook.com"
);
RadPane browserPane =
new
RadPane();
browserPane.Header =
"Facebook Widget"
;
browserPane.Content = browser;
splitContainer.Items.Add(browserPane);
this
.HomePageDocking.Items.Add(splitContainer);
Rod
Hi,
I have a hierarchy gridview where the rows in each childgrid have a column with a checkbox for its value. When the user clicks on that checkbox, I want that child row to enter the parent grid and that child's parent to enter the child grid. In other words, I want to flip-flop the parent row and selected child row.
My problem is I am having trouble finding an event that captures what child row was selected and if they indeed checked off the check box.
I tried to provide screenshots, but I'm having some trouble pasting them into this message. Not sure if it's possible to do so.
Please let me know if you need any additional information.
Thank you,
Joe
I'm wondering how the filters in RadGridView work. How do they check for equality?
After some experimentation it seems that they check for "referential equality" (is that what is it called??), that is the filter checks if the rows have exactly the same object as the filter. So even if a column shows a custom type of mine and I have implemented the Equals() method, it won't matter.
Lets say I
have a custom type representing a customer:
public
class
Customer : IComparable
{
public
int
Id {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
Customer(
int
id,
string
name)
{
Id = id;
Name = name;
}
public
override
string
ToString()
{
return
Name;
}
public
virtual
int
CompareTo(
object
obj)
{
Customer otherCustomer = obj
as
Customer;
if
(otherCustomer !=
null
)
{
return
this
.Id.CompareTo(otherCustomer.Id);
}
else
{
throw
new
ArgumentException(
"Can only compare to other Customer instances."
);
}
}
public
override
bool
Equals(
object
obj)
{
if
(obj.GetType() ==
typeof
(Customer))
{
Customer otherCustomer = (Customer) obj;
return
otherCustomer.Name == Name;
}
else
{
return
false
;
}
}
}
I'm using MVVM and each row displayed in the gridview has a viewmodel. This viewmodel has the following code:
private
Customer _contact;
public
Customer Contact
{
get
{
return
_contact;
}
set
{
if
(value != _contact)
{
_contact = value;
OnPropertyChanged(
"Contact"
);
}
}
}
public
BindingList<Customer> AllContacts {
get
;
private
set
;}
The row-viewmodel has a property called "Contact" that is of my custom type. It also has a BindingList of the same type that will contain all available contact/customers.
And in my XAML I have this code:
<
tgv:RadGridView
ItemsSource
=
"{Binding Path=MyData, Mode=OneWay}"
>
<
tgv:RadGridView.Columns
>
<!-- Columns excluded for brevity... -->
<
tgv:GridViewDataColumn
Name
=
"ContactColumn"
Header
=
"Contact"
DataMemberBinding
=
"{Binding Path=Contact}"
>
<
tgv:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Path=Contact.Name, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
/>
</
DataTemplate
>
</
tgv:GridViewDataColumn.CellTemplate
>
<
tgv:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
ti:RadComboBox
ItemsSource
=
"{Binding Path=AllContacts, Mode=OneTime}"
DisplayMemberPath
=
"Name"
SelectedItem
=
"{Binding Path=Contact, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
/>
</
DataTemplate
>
</
tgv:GridViewDataColumn.CellEditTemplate
>
</
tgv:GridViewDataColumn
>
</
tgv:RadGridView.Columns
>
</
tgv:RadGridView
>
As you can see the column that shows the contact binds to the property Contact on the row-viewmodel. In the cell edit template there's a ComboBox that allows the user to choose one contact from the list with all contacts.
"MyData" that the gridview is bound to is a QueryableCollectionView that has all the rows (row-viewmodels) that are to be displayed. It is created something like this:
RadObservableCollection<DataRowViewModel> myDataRows =
new
RadObservableCollection<DataRowViewModel>();
//...Here would be some code to fill myDataRows with row-viewmodels...
MyData =
new
QueryableCollectionView(myDataRows);
All this works fine.
Now I want to apply filtering on that column by code. Let's say that there are ten available customers. If I open the filter popup on the gridview all ten are displayed in the list of checkboxes where you can specify which ones to show. These are the "distict filters". To apply distinct filters in code behind I would do something like this:
MyData.FilterDescriptors.Clear(); //Clear old filters
ColumnFilterDescriptor cfd =
new
ColumnFilterDescriptor(ContactColumn);
FilterDescriptor fd =
new
FilterDescriptor();
fd.Member =
"Contact"
;
fd.Operator = FilterOperator.IsEqualTo;
fd.Value =
new
Customer(1,
"David"
);
fd.IsCaseSensitive =
true
;
cfd.DistinctFilter.FilterDescriptors.Add(fd);
MyData.FilterDescriptors.Add(cfd);
When I run this I see that a filter is applied, but all my rows are removed by the filter, even those that has Id=1 and Name=David.
I have tried a different model where I don't create a new Customer and put in the Value of the filter but instead put an instance of Customer that is actually in the list AllCustomers. When I do this it works fine. The filter removes all rows except those who has that specific customer (David) as customer. This leads me to think that the filter checks equality by checking "referential equality" and does not use the Equals method.
Am I right in this assumption or is it something else I'm missing?
<
telerik:RadDocking
>
<
telerik:RadSplitContainer
Orientation
=
"Horizontal"
InitialPosition
=
"DockedLeft"
>
<
telerik:RadPaneGroup
prism:RegionManager.RegionName
=
"Left"
/>
</
telerik:RadSplitContainer
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"0.5*"
/>
<
RowDefinition
Height
=
"0.5*"
/>
</
Grid.RowDefinitions
>
<
telerik:DocumentHost
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
prism:RegionManager.RegionName
=
"Main1"
/>
</
telerik:RadSplitContainer
>
</
telerik:DocumentHost
>
<
telerik:DocumentHost
Grid.Row
=
"1"
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
prism:RegionManager.RegionName
=
"Main2"
/>
</
telerik:RadSplitContainer
>
</
telerik:DocumentHost
>
</
Grid
>
</
telerik:RadDocking
>
GridView in WPF Q1 2011 throws a Null Pointer Exception when trying to deselect a previously selected row.
I've tried:
DocumentGrid.UnselectAll()
DocumentGrid.SelectedItems.Clear()
DocumentGrid.SelectedItem = Nothing
All trigger the exception as does Grouping when a row is selected.
The problem only occurs when using an IEnumerable as an ItemsSource. Changing this to mysource.ToList() fixes the problem.
System.Reflection.TargetInvocationException was unhandled
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.DataControl.RaiseSelectionChangedEvent(SelectionChangeEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\DataControl.Selection.cs:line 391
at Telerik.Windows.Controls.GridView.GridViewDataControl.RaiseSelectionChangedEvent(SelectionChangeEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Selection.cs:line 347
at Telerik.Windows.Controls.DataControl.RaiseSelectionChangedEvent(ItemSelectionChange selectionChange) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\DataControl.Selection.cs:line 381
at Telerik.Windows.Controls.DataControl.Telerik.Windows.Data.Selection.ISelectorInternal.RaiseSelectionChangedEvent(ItemSelectionChange selectionChange) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\DataControl.Selection.cs:line 528
at Telerik.Windows.Data.Selection.ItemSelectionHandler.RaiseSelectionChanged(ItemSelectionChange selectionChange) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 928
at Telerik.Windows.Data.Selection.ItemSelectionHandler.RaiseSelectionChangedAndSyncCurrentWithSelectedIfNeeded(ItemSelectionChange selectionChange) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 712
at Telerik.Windows.Data.Selection.ItemSelectionHandler.EndAllowedSelection(ItemSelectionChange selectionChange) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 649
at Telerik.Windows.Data.Selection.ItemSelectionHandler.EndPendingSelection(ItemSelectionChange pendingSelection) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 619
at Telerik.Windows.Data.Selection.ItemSelectionHandler.EndSelection() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 600
at Telerik.Windows.Data.Selection.ItemSelectionHandler.DeselectAllNonExistentItems() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 318
at Telerik.Windows.Data.Selection.ItemSelectionHandler.HandleItemsReset() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 295
at Telerik.Windows.Data.Selection.ItemSelectionHandler.HandleItemsChanged(NotifyCollectionChangedEventArgs itemsChangedArguments) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Selection\ItemSelectionHandler.cs:line 187
at Telerik.Windows.Controls.GridView.Selection.CompositeSelectionHandler.Items_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\Selection\CompositeSelectionHandler.cs:line 63
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 665
at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 642
at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<
System.Collections.Specialized.NotifyCollectionChangedEventArgs
>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 1046
at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 33
at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 679
at Telerik.Windows.Data.QueryableCollectionView.RefreshOverride() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 824
at Telerik.Windows.Data.QueryableCollectionView.RefreshInternal() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 771
at Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 765
at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1044
at Telerik.Windows.Data.QueryableCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 985
at Telerik.Windows.Data.QueryableCollectionView.OnRefresh() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 294
at Telerik.Windows.Data.QueryableCollectionView.Refresh() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 288
at Telerik.Windows.Data.QueryableCollectionView.EndDefer() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Defer.cs:line 60
at Telerik.Windows.Data.QueryableCollectionView.DeferHelper.Dispose() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Defer.cs:line 95
at Telerik.Windows.Data.DataItemCollection.EndDefer() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.ICollectionView.cs:line 208
at Telerik.Windows.Data.DataItemCollection.DeferHelper.Dispose() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.ICollectionView.cs:line 231
at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformGrouping(IGroupDescriptor descriptor, Nullable`1 insertionIndex, GroupingEventAction action) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Grouping.cs:line 182
at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass36.<
RequestGrouping
>b__35() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Grouping.cs:line 137
at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\CursorManager.cs:line 16
at Telerik.Windows.Controls.GridView.GridViewDataControl.RequestGrouping(IGroupDescriptor descriptor, Nullable`1 insertionIndex, GroupingEventAction action) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Grouping.cs:line 127
at Telerik.Windows.Controls.GridView.DragDropController.OnGroupPanelDropInfo(Object sender, DragDropEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\DragDrop\DragDropController.GroupPanel.cs:line 97
at Telerik.Windows.Controls.DragDrop.DragDropEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragDropEventArgs.cs:line 45
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.DragDropProvider_DropInfo(Object sender, DragDropEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:line 319
at Telerik.Windows.Controls.DragDrop.DragDropProviderBase.RaiseDropInfo() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragProviders\DragDropProviderBase.cs:line 170
at Telerik.Windows.Controls.DragDrop.SimulatedDragDropProvider.OnDrop() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragProviders\SimulatedDragDropProvider.cs:line 342
at Telerik.Windows.Controls.DragDrop.SimulatedDragDropProvider.OnCoverRectangleMouseLeftButtonUpInternal() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragProviders\SimulatedDragDropProvider.cs:line 241
at Telerik.Windows.Controls.DragDrop.WPFSimulatedDragDropProvider.OnCoverRectangleMouseLeftButtonUp(Object sender, EventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragProviders\WPFSimulatedDragDropProvider.cs:line 391
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message=Object reference not set to an instance of an object.
Hi,
I am trying to style a RadChart. It is a bargraph (set from code) and I want to change the default colors of the bars. So I used the RadChart.PaletteBrushes and defined SolidBrush colors(Found this method in the following link : http://www.telerik.com/help/wpf/radchart-styling-and-appearance-styling-chart-series.html) as follows:
<telerik:RadChart Background="Transparent" HorizontalContentAlignment="Center" HorizontalAlignment="center">
<telerik:RadChart.PaletteBrushes>
<SolidColorBrush Color="#FF0B3F74"/>
<SolidColorBrush Color="#FF721111"/>
<SolidColorBrush Color="#FFA1720B"/>
</telerik:RadChart.PaletteBrushes>
</telerik:RadChart>
But now, an exception as follows occurs while running the application :
'System.Windows.Media.SolidColorBrush' must have IsFrozen set to false to modify.
This exception occurs randomly. Also, in the stack trace, there is a mention of RadTransition Control too. Why could this error be occuring? How can it be solved?