I set LabelPresenterStyle by GetCheckBoxStyle:
Me.FieldLayouts(index).Fields(Me.FieldItem(j).Name).Settings.LabelPresenterStyle = GetCheckBoxStyle()
there is a XamCheckEditor in LabelPresenterStyle named "ck_all_none" ,how can i get the "ck_all_none" when i want to set it's value by a button in form.
Private Function GetCheckBoxStyle(Optional ByRef isChecked As Boolean = False) As Style Dim chkBox As New FrameworkElementFactory(GetType(XamCheckEditor))
chkBox.SetValue(XamCheckEditor.HorizontalAlignmentProperty, Windows.HorizontalAlignment.Center) chkBox.SetValue(XamCheckEditor.NameProperty, "ck_all_none") chkBox.SetValue(XamCheckEditor.ValueProperty, isChecked) chkBox.SetValue(XamCheckEditor.VerticalAlignmentProperty, Windows.VerticalAlignment.Top) chkBox.AddHandler(XamCheckEditor.ValueChangedEvent, New RoutedPropertyChangedEventHandler(Of Object)(AddressOf SetChecked))
Dim _Style As New Style(GetType(LabelPresenter)) Dim dt As New DataTemplate(GetType(LabelPresenter)) Dim root As New FrameworkElementFactory(GetType(DockPanel)) root.Name = "DockPanel" root.AppendChild(chkBox) dt.VisualTree = root
_Style.Setters.Add(New Setter(LabelPresenter.ContentTemplateProperty, dt))
Return _Style
End Function
HI,
Try this line of code in your button click event
XamCheckEditor ckx = (XamCheckEditor) Infragistics.Windows.Utilities.GetDescendantFromName(xamDataGrid1, "ck_all_none");
Sincerely,
MattDeveloper Support Engineer
I am following up on this forum thead.
If you need additonal help regarding this issue, please let me know.
Sincerely Matt Developer Support Engineer