Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

PerformClick_RadioButtonPart Method, SftTree Class

Selects the specified radiobutton part and automatically deselects all related radiobutton parts.

Class: SftTree
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public bool PerformClick_RadioButtonPart( RadioButtonPartClass rbp );
Public Function PerformClick_RadioButtonPart( ByVal rbp As RadioButtonPartClass ) As Boolean

Parameters

rbp

The radiobutton part to be selected.

Return Value

True if successfull, otherwise False.

Comments

Selects the specified radiobutton part and automatically deselects all related radiobutton parts.

Related radiobuttons are automatically deselected when a radiobutton is selected. Related radiobuttons are located in items on the same level (sibling items) and within the same column.

False is returned if the specified radiobutton is already selected.

Examples

C#

                        cb.State = cb.State == CheckBoxStateEnum.Checked ? CheckBoxStateEnum.Unchecked : CheckBoxStateEnum.Checked;
                        e.Handled = true;
                        // changing the checkbox state doesn't automatically call the CheckBoxClicked event
                        CellClass owningCell = (CellClass)cb.PartOwner;
                        ItemClass owningItem = owningCell.OwningItem;
                        sftTree1_CheckBoxClicked(this, new PartEventArgs(owningItem, owningCell, null, cb));
                    } else if (gp is RadioButtonPartClass) {
                        RadioButtonPartClass rb = (RadioButtonPartClass)gp;
                        if (sftTree1.PerformClick_RadioButtonPart(rb)) {
                            e.Handled = true;
                            // changing the radiobutton state doesn't automatically call the RadioButtonClicked event
                            CellClass owningCell = (CellClass) rb.PartOwner;
                            ItemClass owningItem = owningCell.OwningItem;
                            sftTree1_RadioButtonClicked(this, new PartEventArgs(owningItem, owningCell, null, rb));
                        }
                    }

VB.NET

                End If
                e.Handled = True
                ' changing the checkbox state doesn't automatically call the CheckBoxClicked event
                Dim owningCell As CellClass = cb.PartOwner
                Dim owningItem As ItemClass = owningCell.OwningItem
                SftTree1_CheckBoxClicked(Me, New PartEventArgs(owningItem, owningCell, Nothing, cb))
            ElseIf TypeOf gp Is RadioButtonPartClass Then
                Dim rb As RadioButtonPartClass = gp
                If SftTree1.PerformClick_RadioButtonPart(rb) Then
                    e.Handled = True
                    ' changing the radiobutton state doesn't automatically call the RadioButtonClicked event
                    Dim owningCell As CellClass = rb.PartOwner
                    Dim owningItem As ItemClass = owningCell.OwningItem
                    SftTree1_RadioButtonClicked(Me, New PartEventArgs(owningItem, owningCell, Nothing, rb))
                End If
            End If

See Also SftTree Class | Classes | SftTree/NET 2.0



Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.