NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataGrid.VisibleColumnCount

Gets the number of visible columns.

[Visual Basic]
Public ReadOnly Property VisibleColumnCount As Integer
[C#]
public int VisibleColumnCount {get;}
[C++]
public: __property int get_VisibleColumnCount();
[JScript]
public function get VisibleColumnCount() : int;

Property Value

The number of columns visible in the view port. The viewport is the rectangular area through which the grid is visible. The viewport's size depends on the size of the DataGrid control; if you allow users to resize the control, the viewport will also be affected.

Remarks

The number of visible columns can change depending on their width. For example, if a default width for all columns is set, but a new column's width is set twice as large, the number of visible columns will be reduced by at least one.

Example [Visual Basic]

The following example returns the number of visible columns.

[Visual Basic]

Private Function ReturnVisibleCols(ByVal myGrid As DataGrid) As Integer
   ReturnVisibleCols = myGrid.VisibleColumnCount
End Function

See Also

DataGrid Class | DataGrid Members | System.WinForms Namespace | ColumnHeadersVisible | FirstVisibleColumn | VisibleRowCount