Using a checkbox for String values "1" and "0" instead of true and false
New Discussionin Winforms, I can use a CheckEditorDataFilter (see below) to transform the boolean values that a checkeditor usually works with to string values.
if the value in the field is “1”, the checkbox is checked, and if it is “0” (or String.Empty) the checkbox is not checked.
And when I check the checkbox, it will flip a “1” to a “0” and vice versa.
is this possible with the igx-grid?
Public Class CheckEditorDataFilter
Implements Infragistics.Win.IEditorDataFilter
Public Function Convert(ByVal args As Infragistics.Win.EditorDataFilterConvertArgs) As Object Implements Infragistics.Win.IEditorDataFilter.Convert
If args.Value & "" = "Received" Then Return "0"
Select Case args.Direction
Case Infragistics.Win.ConversionDirection.EditorToOwner
args.Handled = True
Select Case CType(args.Value, CheckState)
Case CheckState.Checked
Return "1"
Case CheckState.Unchecked
Return "0"
Case CheckState.Indeterminate
Return "0"
'Return String.Empty
Case Else
Return "0"
'Return CheckState.Indeterminate
End Select
Case Infragistics.Win.ConversionDirection.OwnerToEditor
args.Handled = True
If args.Value & "" = "1" Then
'Return 1
Return CheckState.Checked
ElseIf args.Value & "" = "0" Then
'Return 0
Return CheckState.Unchecked
Else
Return CheckState.Unchecked
'Return CheckState.Indeterminate
End If
Case Else
Return "0"
'Return CheckState.Indeterminate
End Select
End Function
End Class
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
3 Created On
Aug 06, 2024 Last Post
1 year, 7 months ago 