Hi,
i add a ClickHandler to a CheckBox in a GridViewDataColumn in Codebehind. But this dont fired the Handler when i click the CheckBox.
Can you please show me the right way to do this?
Thank You
.
Here a Code Snippet
i add a ClickHandler to a CheckBox in a GridViewDataColumn in Codebehind. But this dont fired the Handler when i click the CheckBox.
Can you please show me the right way to do this?
Thank You
.
Here a Code Snippet
col =
new
GridViewDataColumn
{
Header = vspriorities[key],
CellTemplate =
new
DataTemplate()
};
cbx =
new
FrameworkElementFactory(
typeof
(CheckBox)); ;
cbx.SetValue(IsHitTestVisibleProperty,
true
);
cbx.SetValue(FocusableProperty,
true
);
cbx.SetValue(TagProperty,
null
);
cbx.SetValue(MarginProperty,
new
Thickness(0, 0, 0, 0));
cbx.SetValue(TagProperty, key);
cbx.SetBinding(DataContextProperty,
new
Binding());
cbx.SetBinding(CheckBox.IsCheckedProperty,
new
Binding(
"PrioritaetId"
) { ConverterParameter = key, Converter = (IValueConverter)TryFindResource(
"EqualsConverter"
), Mode = BindingMode.OneTime });
//cbx.AddHandler(GridViewCheckBox.ClickEvent, new RoutedEventHandler(VSPriority_Checked));
cbx.AddHandler(CheckBox.ClickEvent,
new
RoutedEventHandler (VSPriority_Checked));
//templBorder = new FrameworkElementFactory(typeof(Border));
//templBorder.SetValue(StyleProperty, TryFindResource("GridBorder"));
//templBorder.AppendChild(cbx);
col.CellTemplate.VisualTree = cbx;
col.CellTemplate.Seal();
StatusColumns.Add(col);
lvData.Columns.Insert(idx++, col);