10 Answers, 1 is accepted
0
Hello James,
I would like to suggest you to create a named style with TargetType and apply that style to the desired columns.
Please try this and let me know if it works in your case.
Kind regards,
Vanya Pavlova
the Telerik team
I would like to suggest you to create a named style with TargetType and apply that style to the desired columns.
<
Style
x:Key
=
"Style1"
TargetType
=
"{x:Type telerik:GridViewHeaderCell}"
>
<
Setter
Property
=
"Cursor"
Value
=
"Hand"
/>
</
Style
>
Kind regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0

James
Top achievements
Rank 1
answered on 27 Jul 2010, 03:26 PM
Hi Vanya,
Thanks for your answer. I'm probably doing something obviously wrong, but can't get this working. I get the error message:
My code looks like:
<Style x:Name="HandStyle" TargetType="grid:GridViewCell">
<Setter Property="Cursor" Value="Hand"/>
</Style>
And the columns:
<telerikGridView:GridViewDataColumn Header="Allocated" DataMemberBinding="{Binding TotalAllocation}" CellStyle="HandStyle" IsFilterable="False" Width="60" IsReadOnly="True" TextAlignment="Right"></telerikGridView:GridViewDataColumn>
Can you spot something obviously wrong?
Thanks for your help, James.
Thanks for your answer. I'm probably doing something obviously wrong, but can't get this working. I get the error message:
My code looks like:
<Style x:Name="HandStyle" TargetType="grid:GridViewCell">
<Setter Property="Cursor" Value="Hand"/>
</Style>
And the columns:
<telerikGridView:GridViewDataColumn Header="Allocated" DataMemberBinding="{Binding TotalAllocation}" CellStyle="HandStyle" IsFilterable="False" Width="60" IsReadOnly="True" TextAlignment="Right"></telerikGridView:GridViewDataColumn>
Can you spot something obviously wrong?
Thanks for your help, James.
0
Hi James,
You have defined a CellStyle in GridViewDataColumn,you should define HeaderCellStyle:
Regards,
Vanya Pavlova
the Telerik team
You have defined a CellStyle in GridViewDataColumn,you should define HeaderCellStyle:
HeaderCellStyle={StaticResource HandStyle}
Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0

James
Top achievements
Rank 1
answered on 27 Jul 2010, 08:22 PM
Hi Vanya,
Do I want a header style? I need the hand to appear over the clickable cells and not the header.
Thanks for your help, James.
Do I want a header style? I need the hand to appear over the clickable cells and not the header.
Thanks for your help, James.
0
Hello,
Vlad
the Telerik team
Indeed if you need this for data cells you should use CellStyle however you need the right syntax for referring static resources.
Kind regards,Vlad
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

James
Top achievements
Rank 1
answered on 28 Jul 2010, 09:31 AM
Hi,
Sorry - I'm probably missing some obvious syntax here, but I'm just getting the error: Element is already the child of another element. [Line: 0 Position: 0] for this:
<UserControl x:Class="Myclass..."
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
>
<UserControl.Resources>
<Style x:Key="StyleHand" TargetType="{x:Type telerikGridView:GridViewCell}">
<Setter Property="Cursor" Value="Hand"/>
</Style>
</UserControl.Resources>
<Grid x:Name="LayoutRoot"...
The 'x:Type' is underlined with: "The type 'x:Type' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built."
Thanks for your help, James.
Sorry - I'm probably missing some obvious syntax here, but I'm just getting the error: Element is already the child of another element. [Line: 0 Position: 0] for this:
<UserControl x:Class="Myclass..."
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
>
<UserControl.Resources>
<Style x:Key="StyleHand" TargetType="{x:Type telerikGridView:GridViewCell}">
<Setter Property="Cursor" Value="Hand"/>
</Style>
</UserControl.Resources>
<Grid x:Name="LayoutRoot"...
The 'x:Type' is underlined with: "The type 'x:Type' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built."
Thanks for your help, James.
0
Hello James,
Remove the x:Type from TargetType property and specify the style in this way:
I am sorry for misleading you, I forgot that we cannot specify x:Type in a Style in SIlverlight as we can do in WPF.
Sincerely yours,
Vanya Pavlova
the Telerik team
Remove the x:Type from TargetType property and specify the style in this way:
<
UserControl.Resources
>
<
Style
x:Key
=
"StyleHand"
TargetType
=
"telerikGridView:GridViewCell"
>
<
Setter
Property
=
"Cursor"
Value
=
"Hand"
/>
</
Style
>
</
UserControl.Resources
>
Sincerely yours,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0

James
Top achievements
Rank 1
answered on 28 Jul 2010, 06:26 PM
Hi Vanya,
Thanks for your quick answer. I'm afraid I just went around in circles getting this error: Element is already the child of another element. So I'm just doing it with mouseover events. Would be good to know how to do it properly with styles though!
Thanks, James.
Thanks for your quick answer. I'm afraid I just went around in circles getting this error: Element is already the child of another element. So I'm just doing it with mouseover events. Would be good to know how to do it properly with styles though!
Thanks, James.
0
Accepted
Hello James,
Attached is a sample project which demonstrates the desired behavior.
Please let me know if I can be of further assistance.
Kind regards,
Vanya Pavlova
the Telerik team
Attached is a sample project which demonstrates the desired behavior.
Please let me know if I can be of further assistance.
Kind regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0

James
Top achievements
Rank 1
answered on 29 Jul 2010, 09:18 AM
Brilliant - thanks very much!
The line I was missing was this: xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
I've now put it into my App.xaml Application.resources and am using it throughout the app.
Thanks for your help, James.
The line I was missing was this: xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
I've now put it into my App.xaml Application.resources and am using it throughout the app.
Thanks for your help, James.