Good morning,
I am having a problem when using an in-line CellStyle to set a 'condiitonal' ToolTip. The scenario I'm dealing with boils down to a single column where some rows have a tool-tip and others do not. Initially when hovering over a cell with a tool-tip the tool-tip is displayed correctly. I then hover over a cell without a tool-tip and as expected no tool-tip is displayed; however, upon returning to a cell with a tool-tip the tool-tip is no longer displayed correctly. If you repeat the process the tool-tip will alternate between working and not working. Why are the rows with a tool-tip being affected by the rows without? Thanks in advance!
We are currently on the 2013.2 Telerik libraries.
Below is a code sample that illustrates the problem. First is the ViewModel that holds a simple collection of Model objects.
Next is the simple definition of the Model object.
I set the DataContext of my MainWindow.xaml to an instance of the ViewModel in the MainWindow.xaml.cs
And finally here is the XAML for the MainWindow.xaml that recreates the issue.
Any ideas would be greatly appreciated. Thanks again!
Cheers!
Jason
I am having a problem when using an in-line CellStyle to set a 'condiitonal' ToolTip. The scenario I'm dealing with boils down to a single column where some rows have a tool-tip and others do not. Initially when hovering over a cell with a tool-tip the tool-tip is displayed correctly. I then hover over a cell without a tool-tip and as expected no tool-tip is displayed; however, upon returning to a cell with a tool-tip the tool-tip is no longer displayed correctly. If you repeat the process the tool-tip will alternate between working and not working. Why are the rows with a tool-tip being affected by the rows without? Thanks in advance!
We are currently on the 2013.2 Telerik libraries.
Below is a code sample that illustrates the problem. First is the ViewModel that holds a simple collection of Model objects.
using
System.Collections.ObjectModel;
using
System.Windows;
namespace
ConditionalColumnToolTip
{
public
class
ViewModel
{
public
ViewModel()
{
Models =
new
ObservableCollection<Model>
{
new
Model{ Name =
"HasAToolTip"
, ToolTipVisibility = Visibility.Visible, ToolTipText =
"tool tip text"
},
new
Model{ Name =
"HasAToolTip"
, ToolTipVisibility = Visibility.Visible, ToolTipText =
"tool tip text"
},
new
Model{ Name =
"NoToolTip"
, ToolTipVisibility = Visibility.Collapsed },
new
Model{ Name =
"HasAToolTip"
, ToolTipVisibility = Visibility.Visible, ToolTipText =
"tool tip text"
},
};
}
public
ObservableCollection<Model> Models
{
get
;
set
;
}
}
}
Next is the simple definition of the Model object.
using
System.Windows;
namespace
ConditionalColumnToolTip
{
public
class
Model
{
public
string
Name
{
get
;
set
;
}
public
Visibility ToolTipVisibility
{
get
;
set
;
}
public
string
ToolTipText
{
get
;
set
;
}
}
}
I set the DataContext of my MainWindow.xaml to an instance of the ViewModel in the MainWindow.xaml.cs
using
System.Windows;
namespace
ConditionalColumnToolTip
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
DataContext =
new
ViewModel();
}
}
}
And finally here is the XAML for the MainWindow.xaml that recreates the issue.
<
Window
x:Class
=
"ConditionalColumnToolTip.MainWindow"
xmlns:telerik
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:vm
=
"clr-namespace:ConditionalColumnToolTip"
xmlns:gridView
=
"clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
mc:Ignorable
=
"d"
d:DataContext
=
"{d:DesignInstance vm:ViewModel, IsDesignTimeCreatable=True}"
>
<
Grid
>
<
telerik:RadGridView
ItemsSource
=
"{Binding Models}"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"TITLE"
DataMemberBinding
=
"{Binding Name}"
>
<
telerik:GridViewColumn.CellStyle
>
<
Style
TargetType
=
"{x:Type gridView:GridViewCell}"
BasedOn
=
"{StaticResource {x:Type gridView:GridViewCell}}"
>
<
Setter
Property
=
"ToolTip"
>
<
Setter.Value
>
<
ToolTip
Visibility
=
"{Binding ToolTipVisibility}"
>
<
TextBlock
Text
=
"{Binding ToolTipText}"
/>
</
ToolTip
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
telerik:GridViewColumn.CellStyle
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
Window
>
Any ideas would be greatly appreciated. Thanks again!
Cheers!
Jason