Back to Devexpress

BaseView.GetViewInfo() Method

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-baseview-c0db411c.md

latest6.8 KB
Original Source

BaseView.GetViewInfo() Method

Returns the object which contains the internal information used to render the View.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[EditorBrowsable(EditorBrowsableState.Never)]
public BaseViewInfo GetViewInfo()
vb
<EditorBrowsable(EditorBrowsableState.Never)>
Public Function GetViewInfo As BaseViewInfo

Returns

TypeDescription
DevExpress.XtraGrid.Views.Base.ViewInfo.BaseViewInfo

A DevExpress.XtraGrid.Views.Base.ViewInfo.BaseViewInfo descendant which contains the internal information used to render the View.

|

Remarks

A ViewInfo object contains all the information needed to draw the View. Use the GetViewInfo method to get this internal information.

In most cases there is no need to call this method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetViewInfo() method.

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.

winforms-grid-enable-editing-in-group-row-to-change-cell-values/CS/WindowsApplication3/GroupEditProvider.cs#L96

csharp
{
    GridViewInfo viewInfo = view.GetViewInfo() as GridViewInfo;
    GridGroupRowInfo rowInfo = viewInfo.GetGridRowInfo(hitInfo.RowHandle) as GridGroupRowInfo;

winforms-grid-copy-cell-value-to-other-cells-by-dragging-its-right-bottom-edge/CS/Classes/SelectedCellsBorderHelper.cs#L69

csharp
GridView view = GridControl.FocusedView as GridView;
GridViewInfo info = view.GetViewInfo() as GridViewInfo;
GridCell[] gridCells = view.GetSelectedCells();

winforms-grid-toggle-checkbox-state-with-one-click/CS/Form1.cs#L46

csharp
{
    GridViewInfo vi = view.GetViewInfo() as GridViewInfo;
    GridCellInfo cellInfo = vi.GetGridCellInfo(hi);

winforms-grid-scrolling-by-columns/CS/WindowsApplication3/GridHScrollHelper.cs#L81

csharp
GridViewInfo ViewInfo {
    get { return view.GetViewInfo() as GridViewInfo; }
}

winforms-grid-draw-thick-border-abound-focused-cell/CS/Form1.cs#L132

csharp
e.Appearance.FillRectangle(e.Cache, e.Bounds);
    ((IViewController)view.GridControl).EditorHelper.DrawCellEdit(new GridViewDrawArgs(e.Cache, (view.GetViewInfo() as GridViewInfo), e.Bounds), (e.Cell as GridCellInfo).Editor, (e.Cell as GridCellInfo).ViewInfo, e.Appearance, (e.Cell as GridCellInfo).CellValueRect.Location);
}

winforms-grid-enable-editing-in-group-row-to-change-cell-values/VB/WindowsApplication3/GroupEditProvider.vb#L95

vb
If hitInfo.HitTest = GridHitTest.Row AndAlso view.IsGroupRow(hitInfo.RowHandle) Then
    Dim viewInfo As GridViewInfo = TryCast(view.GetViewInfo(), GridViewInfo)
    Dim rowInfo As GridGroupRowInfo = TryCast(viewInfo.GetGridRowInfo(hitInfo.RowHandle), GridGroupRowInfo)

winforms-grid-toggle-checkbox-state-with-one-click/VB/Form1.vb#L42

vb
If hi.InRowCell Then
    Dim vi As GridViewInfo = TryCast(view.GetViewInfo(), GridViewInfo)
    Dim cellInfo As GridCellInfo = vi.GetGridCellInfo(hi)

winforms-grid-scrolling-by-columns/VB/WindowsApplication3/GridHScrollHelper.vb#L85

vb
Get
    Return TryCast(view.GetViewInfo(), GridViewInfo)
End Get

winforms-grid-draw-thick-border-abound-focused-cell/VB/Form1.vb#L136

vb
e.Appearance.FillRectangle(e.Cache, e.Bounds)
    CType(view.GridControl, IViewController).EditorHelper.DrawCellEdit(New GridViewDrawArgs(e.Cache, (TryCast(view.GetViewInfo(), GridViewInfo)), e.Bounds), (TryCast(e.Cell, GridCellInfo)).Editor, (TryCast(e.Cell, GridCellInfo)).ViewInfo, e.Appearance, (TryCast(e.Cell, GridCellInfo)).CellValueRect.Location)
End Sub

winforms-grid-copy-cells-in-biff8-format-using-excel-export-api/VB/gridCopyToClipboardExample/CopyToClipboardHelper.vb#L93

vb
Private Function GetCellAppearance(ByVal gridRowHandle As Integer, ByVal gridColumn As GridColumn) As AppearanceObject
    Dim viewInfo As GridViewInfo = TryCast(view.GetViewInfo(), GridViewInfo)
    Dim cellInfo As GridCellInfo = viewInfo.GetGridCellInfo(gridRowHandle, gridColumn)

See Also

BaseView Class

BaseView Members

DevExpress.XtraGrid.Views.Base Namespace