Hi Telerik,
I'm having this strange phenomenon where my RadCartesianChart shows my annotations when I create the control directly on the grid of the usercontrol, but not when I try to access it in a datatemplate. The annotations are added to the chart in code behind. In both cases, the code is executed, but I don't see them when using the datatemplate. The lineseries themselves are shown in both cases.
This is the XAML for the chart in the datatemplate:
<DataTemplate DataType="{x:Type entities:ChartMeasurement}">
<Grid>
<telerik:RadCartesianChart Grid.Row="0" HorizontalAlignment="Stretch" Margin="240,15,0,39" Name="radCartesianChart">
<telerik:RadCartesianChart.Resources>
<DataTemplate x:Key="PointTemplate">
<Ellipse Height="8" Width="8" Stroke="White" StrokeThickness="1" Fill="#1B9DDE" />
</DataTemplate>
<Style x:Key="BorderStyle" TargetType="Border">
<Setter Property="Background" Value="#1B9DDE" />
</Style>
</telerik:RadCartesianChart.Resources>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis MajorStep="{Binding MyViewModel.MajorStep}"
MajorStepUnit="{Binding MyViewModel.MajorStepUnit}"
PlotMode="OnTicksPadded"
LabelTemplate="{StaticResource HorizontalAxisLabelTemplate}"
LabelRotationAngle="-90"
LabelFitMode="Rotate"
LineThickness="2"
LineStroke="Gray"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Visibility="Hidden"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.SeriesProvider>
<telerik:ChartSeriesProvider x:Name="myChartSeriesProvider" Source="{Binding MyViewModel.ChartData.MeasurementList}">
<telerik:ChartSeriesProvider.SeriesDescriptors>
<telerik:CategoricalSeriesDescriptor ItemsSourcePath="RawDataList" ValuePath="Value" CategoryPath="Time_Local">
<telerik:CategoricalSeriesDescriptor.Style>
<Style TargetType="telerik:LineSeries">
<Setter Property="StrokeThickness" Value="2"/>
<Setter Property="Stroke" Value="{Binding GraphColorBrush}"/>
<Setter Property="VerticalAxis" Value="{Binding VerticalAxis}"/>
<Setter Property="LegendSettings" Value="{Binding Measurement.Name, Converter={StaticResource LegendSettings}}"/>
</Style>
</telerik:CategoricalSeriesDescriptor.Style>
</telerik:CategoricalSeriesDescriptor>
</telerik:ChartSeriesProvider.SeriesDescriptors>
</telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>
<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorXLinesRenderMode="All" MajorLinesVisibility="XY"/>
</telerik:RadCartesianChart.Grid>
</telerik:RadCartesianChart>
<telerik:RadLegend Items="{Binding LegendItems, ElementName=radCartesianChart}"
FontFamily="Segoe UI"
Grid.Row="0"
Margin="2 52 30 20"/>
</Grid>
</DataTemplate>
As you can see, it is a quite complex graph with a dynamic number of series and 2 vertical axises, where I wan't to combine a number of series on the left vertical axis, and a number of series on the right vertical axis
This is the ChartMeasurement class used in the datatemplate:
public class ChartMeasurement : Measurement
{
private ReportingViewModel _reportingViewModel;
public ChartMeasurement(ReportingViewModel reportingViewModel)
{
_reportingViewModel = reportingViewModel;
MeasurementSignal = new Signal { Name = "Graph" };
}
public ReportingViewModel MyViewModel
{
get { return _reportingViewModel; }
}
}
In code behind, I to the following:
private void RadComboBoxMeasurementPoints_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var reportingView = DataContext as ReportingViewModel;
var measurementPoint = e.AddedItems[0] as MeasurementPoint;
var dataTemplateKey = new DataTemplateKey(typeof(ChartMeasurement));
var dataTemplate = FindResource(dataTemplateKey) as DataTemplate;
if (dataTemplate == null)
{
return;
}
var radCartesianChart = ((Grid)dataTemplate.LoadContent()).Children[0] as RadCartesianChart;
if (reportingView != null &&
measurementPoint != null &&
radCartesianChart != null)
{
radCartesianChart.Annotations.Clear();
var axisLeft = new LinearAxis
{
Title = "",
Minimum = 0,
Maximum = measurementPoint.ScaleLeft,
HorizontalLocation = AxisHorizontalLocation.Left,
TickThickness = 1,
MajorTickLength = 2,
LineThickness = 2,
MajorStep = measurementPoint.ScaleLeft / 10
};
var axisRight = new LinearAxis
{
Title = "",
Minimum = 0,
Maximum = measurementPoint.ScaleRight,
HorizontalLocation = AxisHorizontalLocation.Right,
TickThickness = 1,
MajorTickLength = 2,
LineThickness = 2,
MajorStep = measurementPoint.ScaleRight / 10
};
if (reportingView.ReportData == null)
{
return;
}
var stringLeft = new List<String>();
var stringRight = new List<String>();
foreach (var measurement in reportingView.ReportData.Measurements.Where(m => m.Measurement.MeasurementPoint.Equals(e.AddedItems[0])))
{
if (!measurement.Measurement.HasAxisLeft)
{
measurement.VerticalAxis = axisRight;
stringRight.Add(measurement.Measurement.Name);
if (measurement.Measurement.HasBoundaryValue)
{
radCartesianChart.Annotations.Add(new CartesianGridLineAnnotation
{
Value = measurement.Measurement.BoundaryValue,
Stroke = measurement.GraphColorBrush,
Axis = axisRight,
Label = measurement.Measurement.Name
});
}
}
else
{
measurement.VerticalAxis = axisLeft;
stringLeft.Add(measurement.Measurement.Name);
if (measurement.Measurement.HasBoundaryValue)
{
radCartesianChart.Annotations.Add(new CartesianGridLineAnnotation
{
Value = measurement.Measurement.BoundaryValue,
Stroke = measurement.GraphColorBrush,
Axis = axisLeft,
Label = measurement.Measurement.Name
});
}
}
}
axisRight.Title = String.Join(", ", stringRight);
axisLeft.Title = String.Join(", ", stringLeft);
}
}
This code is executed each time another measurementpoint is selected, but I never see the annotations. The lineseries are shown as expected.
When I omit the datatemplate, and show the chart directly in the grid, it works just fine.
This is the XAML:
<telerik:RadCartesianChart Grid.Row="1" HorizontalAlignment="Stretch" Margin="240,15,0,39" Name="radCartesianChart">
<telerik:RadCartesianChart.Resources>
<DataTemplate x:Key="PointTemplate">
<Ellipse Height="8" Width="8" Stroke="White" StrokeThickness="1" Fill="#1B9DDE" />
</DataTemplate>
<Style x:Key="BorderStyle" TargetType="Border">
<Setter Property="Background" Value="#1B9DDE" />
</Style>
</telerik:RadCartesianChart.Resources>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis MajorStep="{Binding MajorStep}"
MajorStepUnit="{Binding MajorStepUnit}"
PlotMode="OnTicksPadded"
LabelTemplate="{StaticResource HorizontalAxisLabelTemplate}"
LabelRotationAngle="-90"
LabelFitMode="Rotate"
LineThickness="2"
LineStroke="Gray"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Visibility="Hidden"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.SeriesProvider>
<telerik:ChartSeriesProvider Source="{Binding ChartData.MeasurementList, Mode=TwoWay}">
<telerik:ChartSeriesProvider.SeriesDescriptors>
<telerik:CategoricalSeriesDescriptor ItemsSourcePath="RawDataList" ValuePath="Value" CategoryPath="Time_Local">
<telerik:CategoricalSeriesDescriptor.Style>
<Style TargetType="telerik:LineSeries">
<Setter Property="StrokeThickness" Value="2"/>
<Setter Property="Stroke" Value="{Binding GraphColorBrush}"/>
<Setter Property="VerticalAxis" Value="{Binding VerticalAxis}"/>
<Setter Property="LegendSettings" Value="{Binding Measurement.Name, Converter={StaticResource LegendSettings}}"/>
</Style>
</telerik:CategoricalSeriesDescriptor.Style>
</telerik:CategoricalSeriesDescriptor>
</telerik:ChartSeriesProvider.SeriesDescriptors>
</telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>
<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorXLinesRenderMode="All" MajorLinesVisibility="XY"/>
</telerik:RadCartesianChart.Grid>
</telerik:RadCartesianChart>
<telerik:RadLegend Items="{Binding LegendItems, ElementName=radCartesianChart}"
Name="radLegend"
FontFamily="Segoe UI"
Grid.Row="1"
Margin="2 52 30 20"/>
And the code behind:
private void RadComboBoxMeasurementPoints_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var reportingView = DataContext as ReportingViewModel;
var measurementPoint = e.AddedItems[0] as MeasurementPoint;
if (reportingView != null &&
measurementPoint != null &&
radCartesianChart != null)
{
radCartesianChart.Annotations.Clear();
var axisLeft = new LinearAxis
{
Title = "",
Minimum = 0,
Maximum = measurementPoint.ScaleLeft,
HorizontalLocation = AxisHorizontalLocation.Left,
TickThickness = 1,
MajorTickLength = 2,
LineThickness = 2,
MajorStep = measurementPoint.ScaleLeft / 10
};
var axisRight = new LinearAxis
{
Title = "",
Minimum = 0,
Maximum = measurementPoint.ScaleRight,
HorizontalLocation = AxisHorizontalLocation.Right,
TickThickness = 1,
MajorTickLength = 2,
LineThickness = 2,
MajorStep = measurementPoint.ScaleRight / 10
};
if (reportingView.ReportData == null)
{
return;
}
var stringLeft = new List<String>();
var stringRight = new List<String>();
foreach (var measurement in reportingView.ReportData.Measurements.Where(m => m.Measurement.MeasurementPoint.Equals(e.AddedItems[0])))
{
if (!measurement.Measurement.HasAxisLeft)
{
measurement.VerticalAxis = axisRight;
stringRight.Add(measurement.Measurement.Name);
if (measurement.Measurement.HasBoundaryValue)
{
radCartesianChart.Annotations.Add(new CartesianGridLineAnnotation
{
Value = measurement.Measurement.BoundaryValue,
Stroke = measurement.GraphColorBrush,
Axis = axisRight,
Label = measurement.Measurement.Name
});
}
}
else
{
measurement.VerticalAxis = axisLeft;
stringLeft.Add(measurement.Measurement.Name);
if (measurement.Measurement.HasBoundaryValue)
{
radCartesianChart.Annotations.Add(new CartesianGridLineAnnotation
{
Value = measurement.Measurement.BoundaryValue,
Stroke = measurement.GraphColorBrush,
Axis = axisLeft,
Label = measurement.Measurement.Name
});
}
}
}
axisRight.Title = String.Join(", ", stringRight);
axisLeft.Title = String.Join(", ", stringLeft);
dataTemplate.LoadContent();
}
}
As you can see, both code snippets are very alike.
What am I missing here or doing wrong?
The reason for using a datatemplate is that I want the chart to show up in a tab page of a dynamic tab control (dynamic number of tab pages).
Thanks in advance.
Hans.
Hi,
I'm trying to create a TableShape project that will visualize tables from our DB, and will enable the users to open tables and create joins between row in a different tables.
I used your demo's code for the TableShape, but instead of --> SamplesFactory (class) --> LoadSample (method) --> diagram.Load(xml) (line 146), I created a TableShape and added it by using : diagram.AddShape(tableShape).
Now I'm trying to add rows to the table, but I can't use the RowShape you have in the demo, I get an exception that the rowShape not suitable for the tableShape.
How can I solve it? How can I add rows to my table?
Best Regards.
Hello,
we are using a NumericUpdown and have set UpdateValueEvent to PropertyChanged and UpdateSourceTrigger to PropertyChanged for the binding.
The property is updated for each change which is the normal behavior.
The property is not updated when the content of the NumericUpDown is selected and deleted by pressing the Delete key.
In this case the property is updated as soon as the control loses focus.
What we expect and need is an immediate update of the property since this should be the behavior according to the property settings.
Any help would be appreciated. We are using version 2015 Q3.
Regards,
Bert
I am using a TreeListView control and have customized some of the properties to make it match with my application. Overall it seems to be working fine; however I have a handful of users for whom it shows up completely blank. I have been trying to track down the common denominator and it seems so far that all are on windows 7 so I'm thinking that's the cause (though I could be wrong). Below is my xaml file with the overrides I created (FYI the RDStyles.xaml that it references is just my standard colors as brushes, some button styles, etc.). Why would it just not show up?
<ResourceDictionary 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">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="RDStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type telerik:GridViewHeaderCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:GridViewHeaderCell}">
<Grid x:Name="PART_OuterGrid">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.2" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="Normal"/>
<VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.2" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="MouseOver"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Over">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Ascending">
<Storyboard>
<ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_SortIndicator">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Selected">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Descending">
<Storyboard>
<ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0:0:0.001" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_SortIndicator">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderTransform" Storyboard.TargetName="PART_SortIndicator">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<ScaleTransform ScaleY="-1" ScaleX="1"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Selected">
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="PART_HeaderCellGrid" MinHeight="26">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border x:Name="GridViewHeaderCell" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Margin="1,0,0,0">
<Border BorderBrush="#FF4B4B4B" BorderThickness="1" Background="{TemplateBinding Background}"/>
</Border>
<Border x:Name="GridViewHeaderCell_Over" BorderBrush="{StaticResource br_RDBlue}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
<Border BorderBrush="{StaticResource br_RDBlue}" BorderThickness="1" Background="{StaticResource br_RDBlueHighlight}">
</Border>
</Border>
<Border x:Name="GridViewHeaderCell_Selected" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF616161" Offset="0"/>
<GradientStop Color="#FF989898" Offset="1"/>
</LinearGradientBrush>
</Border.BorderBrush>
<Border BorderThickness="1">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB69A78"/>
<GradientStop Color="#FFFFE17A" Offset="0.126"/>
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFD74E" Offset="0.996"/>
<GradientStop Color="#FFFFDCAB" Offset="0.17"/>
<GradientStop Color="#FFFFB062" Offset="0.57"/>
<GradientStop Color="#FFFFD18F" Offset="0.56"/>
<GradientStop Color="#FFFFBA74"/>
</LinearGradientBrush>
</Border.Background>
</Border>
</Border>
<ContentControl x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="{TemplateBinding IsTabStop}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<ContentControl.Style>
<Style TargetType="{x:Type ContentControl}">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
</ContentControl.Style>
</ContentControl>
<Path x:Name="PART_SortIndicator" Grid.ColumnSpan="2" Data="M256,328L248,336 264,336" Fill="Black" HorizontalAlignment="Center" Height="3" Margin="0,3,0,0" Opacity="0" RenderTransformOrigin="0.5,0.5" Stretch="Fill" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1" ScaleX="1"/>
<SkewTransform AngleY="0" AngleX="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<ContentControl Grid.ColumnSpan="2" Foreground="Black" FontSize="7" HorizontalAlignment="Center" IsTabStop="{TemplateBinding IsTabStop}" Margin="14,0,0,0" VerticalAlignment="Top">
<ContentControl.Visibility>
<Binding Path="SortingIndex" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:SortingIndexToVisibilityConverter/>
</Binding.Converter>
</Binding>
</ContentControl.Visibility>
<Binding Path="SortingIndex" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:SortingIndexConverter/>
</Binding.Converter>
</Binding>
</ContentControl>
<telerik:FilteringDropDown x:Name="PART_DistinctFilterControl" Grid.Column="1" IsTabStop="False" Margin="0,0,4,0" Visibility="{TemplateBinding FilteringUIVisibility}">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</telerik:FilteringDropDown>
<Thumb x:Name="PART_LeftHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Left" IsTabStop="{TemplateBinding IsTabStop}">
<Thumb.Style>
<Style TargetType="{x:Type Thumb}">
<Setter Property="Width" Value="8"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Cursor" Value="SizeWE"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Thumb.Style>
</Thumb>
<Thumb x:Name="PART_RightHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Right" IsTabStop="{TemplateBinding IsTabStop}">
<Thumb.Style>
<Style TargetType="{x:Type Thumb}">
<Setter Property="Width" Value="8"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Cursor" Value="SizeWE"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Thumb.Style>
</Thumb>
</Grid>
<telerik:FieldFilterControl x:Name="PART_FieldFilterControl" Column="{x:Null}" IsTabStop="False" telerik:TouchManager.IsTouchHitTestVisible="False" Grid.Row="1" Visibility="{TemplateBinding FieldFilterControlVisibility}">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</telerik:FieldFilterControl>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="5,0,3,0"/>
<Setter Property="DropIndicatorBrush" Value="White"/>
<Setter Property="DropIndicatorThickness" Value="2"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Background" Value="{StaticResource br_RDBlueLowlight}" />
</Style>
<Style TargetType="{x:Type telerik:GridViewCell}" x:Key="st_CellBase">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:GridViewCell}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected"/>
<VisualState x:Name="Selected">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Background_Selected">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Background_Over">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="EditingStates">
<VisualState x:Name="Edited">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Thickness>0</Thickness>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="PART_ContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<VerticalAlignment>Stretch</VerticalAlignment>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="PART_CellBorder">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Display"/>
</VisualStateGroup>
<VisualStateGroup x:Name="DisabledStates">
<VisualState x:Name="Enabled"/>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_CellBorder">
<DiscreteDoubleKeyFrame KeyTime="0" Value="0.4"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_ContentPresenter">
<DiscreteDoubleKeyFrame KeyTime="0" Value="0.7"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Background_Disabled">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ValueStates">
<VisualState x:Name="CellValid"/>
<VisualState x:Name="CellInvalid">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Background_Invalid">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="CellInvalidUnfocused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Background_Invalid_Unfocused">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="PART_CellBorder" BorderBrush="{TemplateBinding VerticalGridLinesBrush}" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}">
<Border.BorderThickness>
<Binding ConverterParameter="Right" Path="VerticalGridLinesWidth" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:GridLineWidthToThicknessConverter/>
</Binding.Converter>
</Binding>
</Border.BorderThickness>
</Border>
<Border x:Name="Background_Over" BorderBrush="#FFFFC92B" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,2,2" Visibility="Collapsed">
<Border BorderBrush="White" BorderThickness="1">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFBA3" Offset="1"/>
<GradientStop Color="#FFFFFBDA" Offset="0"/>
</LinearGradientBrush>
</Border.Background>
</Border>
</Border>
<Border x:Name="Background_Selected" BorderBrush="#FFFFC92B" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,2,2" Visibility="Collapsed">
<Border BorderBrush="White" BorderThickness="1">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFCE79F" Offset="1"/>
<GradientStop Color="#FFFDD3A8"/>
</LinearGradientBrush>
</Border.Background>
</Border>
</Border>
<Border x:Name="Background_Invalid" BorderBrush="#FFDB000C" BorderThickness="1" Background="White" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,2,2" Visibility="Collapsed">
<Border.ToolTip>
<ToolTip x:Name="validationTooltip" Content="{TemplateBinding Errors}" Placement="Right">
<ToolTip.Template>
<ControlTemplate TargetType="{x:Type ToolTip}">
<Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
<Grid.RenderTransform>
<TranslateTransform X="-25"/>
</Grid.RenderTransform>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="OpenStates">
<VisualStateGroup.Transitions>
<VisualTransition From="{x:Null}" GeneratedDuration="0" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="{x:Null}"/>
<VisualTransition From="{x:Null}" GeneratedDuration="0:0:0.2" GeneratedEasingFunction="{x:Null}" To="Open">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Closed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Open">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel IsItemsHost="True"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#FFDC000C" BorderThickness="1" CornerRadius="1" MinHeight="22">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFF424C" Offset="1"/>
<GradientStop Color="#FFC92931"/>
</LinearGradientBrush>
</Border.Background>
<Border BorderBrush="White" BorderThickness="1">
<TextBlock Foreground="White" MaxWidth="250" Margin="4,1" TextWrapping="Wrap" Text="{Binding}"/>
</Border>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ControlTemplate>
</ToolTip.Template>
</ToolTip>
</Border.ToolTip>
<Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
<Path Data="M1,0L6,0A2,2,90,0,1,8,2L8,7z" Fill="#FFDB000C" Margin="1,3,0,0"/>
<Path Data="M0,0L2,0 8,6 8,8" Fill="White" Margin="1,3,0,0"/>
</Grid>
</Border>
<Border x:Name="Background_Invalid_Unfocused" BorderBrush="#FFCE7D7D" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" Opacity="1" Visibility="Collapsed">
<Border BorderThickness="1">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFEBF4FD"/>
<GradientStop Color="#FFDBEAFD" Offset="1"/>
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFCDCDC"/>
<GradientStop Color="#FFFCC1C1" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
</Border>
<Border x:Name="Background_Disabled" BorderBrush="#FFF8F8F8" BorderThickness="1" Background="#FFE0E0E0" Grid.ColumnSpan="2" Grid.Column="2" Margin="0,0,1,1" Visibility="Collapsed"/>
<ContentPresenter x:Name="PART_ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="5,0,3,0"/>
<Setter Property="BorderBrush" Value="#FFCBCBCB"/>
<Setter Property="BorderThickness" Value="0,0,1,0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
</Style>
<Style TargetType="{x:Type telerik:GridViewCell}" BasedOn="{StaticResource st_CellBase}" x:Key="st_CellTopJustify">
<Setter Property="VerticalContentAlignment" Value="Stretch" />
</Style>
<Style TargetType="{x:Type telerik:GridViewCell}" BasedOn="{StaticResource st_CellBase}" />
</ResourceDictionary>
Hi,
Please he me in merging RadGridview columns. i need to merge the 2 or 3 columns headers alone, with out the columns headers.
I need something as shown in below picture.
Thanks
Rajeev
Hello!
I find I can not Input chinese character with QQ wubi IME
how can I input chinese character not with Microsoft Windows IME?
We have gone through feedback about UI virtualzation in Telerik grdiview but cant cant find solution for below approach
We have gridview in which we are loading data but We are facing issues in enable/disable Cell or Focus cell at any row of GridView.
Visualization is set to ON and we are using below code to get all rows of gridview
var rows = RadGridView1.ChildrenOfType<GridViewRow>();
this code is returning only those set of rows which are visible in viewport
Those rows that are visible in the view port are initialized and can be access to cell which are visible in view port .however problem occurs with remaining rows which are not visible in View Port. when We tried to access rows with are not visible in view port but loaded in Radgrdiview , then it throws error "Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
Is there any way through which we can access all rows . so that i can enable or disable any cell of RadGrdiView?
We don't want to disable Visualization, that will impact on performance of RadGridView.