I put this control on a grid and it dramatically reduces the rendering speed of the grid. It takes noticeably longer to scroll down.
Am I doing something wrong?
Here is what I have added to the Grid.
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Rating}"
Header
=
"Rating"
MinWidth
=
"60"
Width
=
"SizeToCells"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
telerikInput:RadRating
Name
=
"_leadRating"
Value
=
"{Binding Path=Rating,Mode=TwoWay}"
UseLayoutRounding
=
"True"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"ValueChanged"
>
<
cmd:EventToCommand
Command
=
"{Binding Path=DataContext.ChangeRatingCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl, AncestorLevel=1}}"
CommandParameter
=
"{Binding}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
</
telerikInput:RadRating
>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
Grid.Resources
>
<
local:KPI_Diff_Style
x:Key
=
"_DiffStyle"
>
<
local:KPI_Diff_Style.UpStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"Red"
/>
</
Style
>
</
local:KPI_Diff_Style.UpStyle
>
<
local:KPI_Diff_Style.DownStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"Yellow"
/>
</
Style
>
</
local:KPI_Diff_Style.DownStyle
>
<
local:KPI_Diff_Style.EqStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"Green"
/>
</
Style
>
</
local:KPI_Diff_Style.EqStyle
>
</
local:KPI_Diff_Style
>
</
Grid.Resources
>
<
telerik:RadGridView
x:Name
=
"gridKPI"
CanUserFreezeColumns
=
"False"
ItemsSource
=
"{Binding}"
ShowGroupPanel
=
"False"
GridLinesVisibility
=
"Horizontal"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding KPINameDisplay}"
Header
=
"KPI Trends"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding KPIName}"
Header
=
"KPI Name"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding MapKPIColumnName}"
Header
=
"KPI Column Name"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding StartDate}"
Header
=
"Start Date"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding EndDate}"
Header
=
"End Date"
/>
<
telerik:GridViewImageColumn
DataMemberBinding
=
"{Binding ImageUpDown}"
Header
=
"Difference"
ImageStretch
=
"None"
CellStyleSelector
=
"{StaticResource _DiffStyle}"
MinWidth
=
"5"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ImageView}"
Header
=
"View"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Button
Content
=
"View Details"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
private
void
Window_Loaded(
object
sender, RoutedEventArgs e)
{
// Get GridView ScrollBar object
ScrollBar verticalScrollBar =
this
.RadGridView1.ChildrenOfType<ScrollBar>().Where(s => s.Orientation == Orientation.Vertical).First();
// Set value on GridView - Goes to bottom, but cannot get scrollbar to move
verticalScrollBar.Value = verticalScrollBar.Maximum;
// Set value on WPF ScrollBar - Goes to bottom, and scrollbar moves fine
this
.WpfBar1.Value =
this
.WpfBar1.Maximum;
}
I have a GridView with several columns. I am using a subset of columns to the right to show bars like a kind of Gantt chart.
I want to style the cells in the rows in such a way that each Cell merge with the cell to its left and the cell to its right (no merge with above or below cells) in order to produce the impression that there is a horizontal bar created by setting the background color.
I set up padding and also margin to (0,10, 0,10) in the Cell Template and hidden the columns vertical lines but I still get a gap between the cells.
I also created a GridViewCellStyle copied from the default as suggested in the documentation, I assigned to the DataColumns tag but make no difference. I can't get rid of the gaps. So I may be doing something wrong.
1. Could you be so kind of tell me how can I get this result.
2. I need to change the name of the columns header dynamically. I can do it from code behind but if I want to do it from XAML how I do that?
Thanks