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
415
UltraTree node with a checkbox column default value (Version 9.1)
posted

I implemented a ultretree with nodes that their first column is a checkbox, with all boxes unchecked.  However, the default behavior of the checkbox seems to be 'tristate", as seen on the screen print: 

For example, the first two nodes' (marked as yellow)  checkbox have blue background (represent null state?).  I have to click it once to make the blue backqround turn to gray (uncheck).  I have to then click it again to check the checkbox.

How do I set up the checkboxes so they default to "uncheck" state and users has to click on it only once to check it? 

Here is the codes I have:

 _icd10ColSet = New UltraTreeColumnSet()

_icd10ColSet.ColumnAutoSizeMode = UltraWinTree.ColumnAutoSizeMode.AllNodesWithDescendants

_icd10ColSet.Key =

 

"ICD10" 

Dim chkICD10 As UltraTreeNodeColumn = _icd10ColSet.Columns.Add("S")

chkICD10.DataType =

 

GetType(Boolean) "ICD-10")

_icd10ColSet.Columns.Add(

"ICD-10 Description")

chkICD10.AllowCellEdit = AllowCellEdit.Full

_icd10ColSet.Columns.Add(

 

 

  treeView.ColumnSettings.ColumnSets.Add(_icd10ColSet)

.........

Thanks,

Steve

 

  • 469350
    Offline posted

    Hi Steve,

    The default value of any cell is null. So you need to explicitly set the value on these cells to false.

    If your tree is bound to a DataSource, then the easiest thing to do is use the InitializeDataNode event and populate the value of the unbound checkbox cell in the node the first time the node is initialized (e.ReInitialize == false).

    If your tree is not bound, then you can just set the cell value to false when you add the node to the tree.