Exemplo n.º 1
0
        // Obtain folder check state for hierarchy folder mode.
        public Boolean?getFolderCheckState(BaseTreeNode treeNode)
        {
            if (treeNode.Children.Count < 1)
            {
                return(true);
            }
            else
            {
                CheckState firstItem = Column.GetCheckState(treeNode.Children[0]);
                for (int i = 1; i < treeNode.Children.Count; i++)
                {
                    if (Column.GetCheckState(treeNode.Children[i]) != firstItem)
                    {
                        firstItem = CheckState.Indeterminate;
                        break;
                    }
                }
                switch (firstItem)
                {
                case CheckState.Checked: return(true);

                case CheckState.Unchecked: return(false);

                default: return(null);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Toggle the check at the check box of the given cell
        /// </summary>
        /// <param name="rowObject"></param>
        /// <param name="column"></param>
        public virtual void ToggleSubItemCheckBox(object rowObject, OLVColumn column)
        {
            CheckState currentState = column.GetCheckState(rowObject);
            CheckState newState = CalculateToggledCheckState(column, currentState);

            SubItemCheckingEventArgs args = new SubItemCheckingEventArgs(column, this.ModelToItem(rowObject), column.Index, currentState, newState);
            this.OnSubItemChecking(args);
            if (args.Canceled)
                return;

            switch (args.NewValue) {
                case CheckState.Checked:
                    this.CheckSubItem(rowObject, column);
                    break;
                case CheckState.Indeterminate:
                    this.CheckIndeterminateSubItem(rowObject, column);
                    break;
                case CheckState.Unchecked:
                    this.UncheckSubItem(rowObject, column);
                    break;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Is there a check at the check box at the given cell
 /// </summary>
 /// <param name="rowObject"></param>
 /// <param name="column"></param>
 public virtual bool IsSubItemChecked(object rowObject, OLVColumn column)
 {
     if (column != null && rowObject != null && column.CheckBoxes)
         return (column.GetCheckState(rowObject) == CheckState.Checked);
     else
         return false;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Is there a check at the check box at the given cell
 /// </summary>
 /// <param name="rowObject"></param>
 /// <param name="column"></param>
 public virtual bool IsSubItemChecked(object rowObject, OLVColumn column) {
     if (column == null || rowObject == null || !column.CheckBoxes) 
         return false;
     return (column.GetCheckState(rowObject) == CheckState.Checked);
 }