Back to Devexpress

BaseRow.Visible Property

windowsforms-devexpress-dot-xtraverticalgrid-dot-rows-dot-baserow-7776f890.md

latest5.2 KB
Original Source

BaseRow.Visible Property

Gets or sets a value indicating whether a row can be displayed within a vertical grid control.

Namespace : DevExpress.XtraVerticalGrid.Rows

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

csharp
[DefaultValue(true)]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public bool Visible { get; set; }
vb
<DefaultValue(True)>
<XtraSerializableProperty>
<DXCategory("Appearance")>
Public Property Visible As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if a row can be displayed; otherwise, false.

|

Remarks

Use the Visible property to control row visibility.

If this property is true , a row is visible within the grid control if all its parent rows are expanded. Using the BaseRow.VisibleIndex property you can obtain the absolute position of the current visible row within the grid control.

If set to false , the row will not be displayed within the control. In this case, it is located within the Customization Form if its VGridOptionsRow.ShowInCustomizationForm option is enabled. If this option is disabled, the row is not displayed in the grid control or Customization Form. Note that for rows whose Visible property is false the BaseRow.VisibleIndex property returns -1.

When manipulating any row collection represented by a VGridRows object, you can use the VGridRows.FirstVisible and VGridRows.LastVisible properties to correspondingly obtain the first and last rows within the collection whose Visible property is true.

Example

The following sample code iterates through the grid’s collection of top level rows and makes visible all the hidden rows not displayed in the Customization Form. So rows are checked based upon the values of their BaseRow.Visible property and VGridOptionsRow.ShowInCustomizationForm option.

csharp
private void RestoreHiddenRows() {
    foreach (BaseRow row in vGridControl1.Rows) {
        if (!row.Visible && !row.OptionsRow.ShowInCustomizationForm) row.Visible = true;
    }
}
vb
Private Sub RestoreHiddenRows()
    Dim Row As BaseRow
    For Each Row In VGridControl1.Rows
        If (Not Row.Visible) And (Not Row.OptionsRow.ShowInCustomizationForm) Then 
          Row.Visible = True
        EndIf
    Next
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Visible property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

dashboard-constant-lines/CS/ConstantLineExtension.Win/ConstantLineDialog.cs#L81

csharp
if(constantLineData != null) {
    propertyGridControl1.GetRowByFieldName(nameof(CustomConstantLine.MeasureId)).Visible = constantLineData.IsBound;
    propertyGridControl1.GetRowByFieldName(nameof(CustomConstantLine.Value)).Visible = !constantLineData.IsBound;

See Also

FirstVisible

LastVisible

VisibleIndex

Customization Form - Vertical Grid

BaseRow Class

BaseRow Members

DevExpress.XtraVerticalGrid.Rows Namespace