<Grid x:Name="PART_Grid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="*" /> |
<!-- Column 0 - tail --> |
<ColumnDefinition Width="*" /> |
<!-- Column 1 - pin point --> |
<ColumnDefinition Width="*" /> |
<!-- Column 2 - arrow --> |
</Grid.ColumnDefinitions> |
<Grid.RowDefinitions> |
<RowDefinition Height="*" /> |
</Grid.RowDefinitions> |
<Window x:Class="WpfApplication28.MainWindow" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
Title="MainWindow" Height="350" Width="525" Background="Gray"> |
<Grid> |
<Grid.Resources> |
<ControlTemplate x:Key="Tubo"> |
<telerik:RadialGauge Width="150" Height="150"> |
<telerik:RadialScale Name="radialScale" StartAngle="135" SweepAngle="270" Radius=".95" |
MajorTicks="5" MinorTicks="1" MiddleTicks="1" LabelRotationMode="None"> |
<telerik:RadialScale.Label> |
<telerik:LabelProperties Location="Inside" FontSize="20" Foreground="Red" /> |
</telerik:RadialScale.Label> |
</telerik:RadialScale> |
</telerik:RadialGauge> |
</ControlTemplate> |
<Style TargetType="{x:Type Control}"> |
<Setter Property="Template" Value="{StaticResource Tubo}"> |
</Setter> |
</Style> |
</Grid.Resources> |
<Grid.RowDefinitions> |
<RowDefinition /> |
<RowDefinition /> |
</Grid.RowDefinitions> |
<Control /> |
<telerik:RadialGauge Grid.Row="1"> |
<telerik:RadialScale Name="radialScale" StartAngle="135" SweepAngle="270" Radius=".95" |
MajorTicks="5" MinorTicks="1" MiddleTicks="1" LabelRotationMode="None"> |
<telerik:RadialScale.Label> |
<telerik:LabelProperties Location="Inside" FontSize="20" Foreground="Red" /> |
</telerik:RadialScale.Label> |
</telerik:RadialScale> |
</telerik:RadialGauge> |
</Grid> |
</Window> |
<GroupBox Style="{DynamicResource NoTitledGroupBox}" Grid.Row="1" Margin="20,5,20,20">
<telerikChart:RadChart x:Name="RadChart1">
</telerikChart:RadChart>
</GroupBox>
RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"{0:F2}"
RadChart1.DefaultView.ChartArea.AxisX.MaxValue = 1000
RadChart1.DefaultView.ChartArea.AxisX.MinValue = 0
RadChart1.DefaultView.ChartArea.AxisX.[Step] = 100.0
RadChart1.DefaultView.ChartArea.AxisY.ExtendDirection = AxisExtendDirection.Smart
RadChart1.DefaultView.ChartArea.AxisX.Step = 100.0
RadChart1.DefaultView.ChartArea.AxisY.Title =
"Head"
RadChart1.DefaultView.ChartArea.AxisX.Title =
"GPM"
'RadChart1.DefaultView.ChartArea.AxisY.AxisStyles.TitleStyle = TryCast(Resources("CustomAxisTitleStyle"), Style)
Dim dsSeries As DataSeries = GenerateSeries(obj.getAdjustedHeadCalc, obj.getAdjustedCapacity)
dsSeries.LegendLabel =
"Head"
dsSeries.Definition =
New LineSeriesDefinition
RadChart1.DefaultView.ChartArea.DataSeries.Add(dsSeries)
I have about 17 points. The YAxis draws the labels fine but I see some missing tick marks. I want 10 ticks on the XAxis but it keeps drawing 17 ticks and the labels are all messed up. Is there anything I am doing wrong?
I have attached the produced chart with the above code.
Regards,
Boaz
<Window.Resources>
<bl:TimeBand x:Key="timeBands"/>
</Window.Resources>
...
<telerik:RadGridView Name="grTimeBand" AutoGenerateColumns="False" ActionOnLostFocus="CommitEdit" ShowGroupPanel="False" ItemsSource="{Binding Source={StaticResource timeBands}, Path=TimeBandTable, debug:PresentationTraceSources.TraceLevel=High}">
<telerik:RadGridView.Columns>
<telerik:GridViewComboBoxColumn Header="InclAllSpecDays" Width="100" ItemsSourceBinding="{Binding Source={StaticResource booleanValues}, Path=BooleanValueList}" DataMemberBinding="{Binding INCLUSIVE_ALL_SPECIAL_DAYS}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding START_TIME}">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding START_TIME, debug:PresentationTraceSources.TraceLevel=High}" /> ?????
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerikInput:RadDatePicker SelectedDate="{Binding START_TIME, Mode=TwoWay}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="EndTime" Width="100" DataMemberBinding="{Binding END_TIME}"/>
...
</telerik:RadGridView.Columns>
</telerik:RadGridView>
I'm trying to replace my DataGrid with a RadGridView from Telerik. My control has a ViewModel as DataContext which has a property "DbObject". It is of the type "DbBaseObject". Now there could be any descendant of this type filled into the GridView. Some of them may have a property "Name", some may not. The standard WPF-Controls are pretty soft when evaluating a property that doesn't exist -> they just show an empty value. The RadGridView gives me Exceptions: |
ArgumentException "Property with name Name cannot be found on type DbBaseObject" |
and afterwards |
Invalid property or field - 'Name' for type: DbBaseObject |
This is true, the DbBaseObject doesn't have a property "Name" but this shouldn't be a reason not to show a column. Is there anything I can do to soften this behavior up? |