Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
655
Edit a boolean column displays 'True' or 'False'
posted
I fill a ULTRAGRID with data, which then I want to edit. 
This grid has a column with a boolean data ("ACTIVE" column).
When I load the data, the column appears with a CHECKBOX, which is what I want.
At the time I go into edit mode, column data become text ("True" "False").

To test only create a form and add an UltraGrid and a UltraButton:

Private Sub UltraButton1_Click(sender As System.Object, e As System.EventArgs) Handles UltraButton1.Click

Dim dt As New DataTable

dt.Columns.Add("NAME", System.Type.GetType("System.String"))
dt.Columns.Add("ACTIVE", System.Type.GetType("System.Boolean"))

dt.Rows.Add("One", True)
dt.Rows.Add("Two", False)
dt.Rows.Add("Three", True)
dt.Rows.Add("Four", False)
dt.Rows.Add("Five", True)



UltraGrid1.DataSource = dt

Dim _objEdicionCheck As New Infragistics.Win.UltraWinEditors.UltraCheckEditor

_objEdicionCheck.Style = EditCheckStyle.Check
_objEdicionCheck.Visible = True
UltraGrid1.DisplayLayout.Bands(0).Columns("ACTIVE").Style = UltraWinGrid.ColumnStyle.CheckBox

Dim ucCheck As New Infragistics.Win.UltraWinEditors.UltraControlContainerEditor

Me.Controls.Add(_objEdicionCheck)
ucCheck.EditingControl = _objEdicionCheck
ucCheck.EditingControlPropertyName = "Checked"
UltraGrid1.DisplayLayout.Bands(0).Columns("ACTIVE").EditorComponent = ucCheck

End Sub


If I edit the column (by double click), the cell becomes in a checkbox.. and when I leave the cell, the columns returns to "True" or "False"

Why the column lost the style (EditCheckStyle.Check)?