Hi,
I am creating GridViewComboBoxColumn dynamically in code behind and want to bind ToolTip of the cells in this column to some property as below
But couldn't get it working.
But if I do its equivalent (I believe so) in XAML as described here, it works. Unfortunately the column is created on runtime so I can't go with XAML option.
Any ideas/suggestions?
Arpit
I am creating GridViewComboBoxColumn dynamically in code behind and want to bind ToolTip of the cells in this column to some property as below
var colLabor =
new
GridViewComboBoxColumn();
var tTemp =
new
DataTemplate() { DataType =
typeof
(Labor) };
FrameworkElementFactory factoryTextBlock =
new
FrameworkElementFactory(
typeof
(TextBox)) { Name =
"factoryTextBlock"
};
//factoryTextBlock.SetBinding(TextBlock.TextProperty, new Binding("ResourceTypeId"));
factoryTextBlock.SetValue(TextBox.TextProperty,
"OK BYE"
);
factoryTextBlock.SetValue(TextBox.FontSizeProperty, 10.0d);
factoryTextBlock.SetValue(TextBox.WidthProperty, 100.0d);
tTemp.VisualTree = factoryTextBlock;
colLabor.ToolTipTemplate = tTemp;
But couldn't get it working.
But if I do its equivalent (I believe so) in XAML as described here, it works. Unfortunately the column is created on runtime so I can't go with XAML option.
Any ideas/suggestions?
Arpit