or

RadChart.DefaultView.ChartLegend.Foreground =
new SolidColorBrush(Colors.Black);
How can i do this?
Thanks.

| Dim ffd As FieldFilterDescription = Nothing |
| For Each cell As GridViewHeaderCell In cells |
| Dim column As GridViewDataColumn = DirectCast(cell.Column, GridViewDataColumn) |
| Dim descriptions As IEnumerable(Of FieldFilterDescription) = radGridView.FilterDescriptors.OfType(Of FieldFilterDescription)() |
| ffd = (From fd In descriptions Where fd.FieldName = column.UniqueName Select fd).FirstOrDefault() |
| Dim element As FrameworkElement = Nothing |
| element = New TextBox() |
| element.Height = 24 |
| element.Margin = New Thickness(3, 3, 3, 5) |
| If ffd IsNot Nothing Then |
| ffd.Filter1.[Operator] = Telerik.Windows.Data.FilterOperator.Contains |
| BindText(element, "Value", ffd.Filter1) |
| End If |
| next |
| Private Sub BindText(ByVal ptextBox As TextBox, ByVal pproperty As String, ByVal source As Object) |
| Dim textProp As DependencyProperty = TextBox.TextProperty |
| If Not BindingOperations.IsDataBound(ptextBox, textProp) Then |
| Dim b As Binding = New Binding(pproperty) |
| b.Source = source |
| b.Mode = BindingMode.TwoWay |
| b.Path = New PropertyPath(pproperty) |
| ptextBox.SetBinding(TextBox.TextProperty, b) |
| End If |
| End Sub |
| DataSeries ds1 = new DataSeries(); |
| ds1.LegendLabel = "Random"; |
| ds1.Definition = new Telerik.Windows.Controls.Charting.LineSeriesDefinition(); |
| FillDataSeries(ds1); // Fills series data points with XValue and YValue |
| chartArea1.DataSeries.Add(ds1); |
When the code runs, a NullReferenceException is thrown.
----------------------------------------------------------------------------------------------------------
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Controls.Charting.BaseAnimationConverter.GetAnimationSettings() in c:\Builds\WPF_Scrum\Chart_WPF_2009_Q2_SP1\Sources\Development\Controls\Chart\Chart\Animations\BaseAnimationConverter.cs:line 163
-----------------------------------------------------------------------------------------------------------
what am I missing?
Thanks.