Class GridViewLayout
Implements the Grid layout view. Whenever changes are made to the view or the grid is scrolled, all information in this class is refreshed.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridViewLayout : GridSubComponent, IDisposable
Remarks
You get access to this class with the ViewLayout property of a GridControlBase.
Constructors
GridViewLayout(GridControlBase)
Initializes the new instances of the GridViewLayout class and associates it with a grid.
Declaration
public GridViewLayout(GridControlBase grid)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | grid | The grid control. |
Properties
Corner
Gets the bottom-right corner point in client coordinates of the visible grid. To the right and to the bottom of this grid is a non-grid background area.
Declaration
public Point Corner { get; }
Property Value
Type |
---|
System.Drawing.Point |
HasPartialVisibleCols
Gets a value indicating whether True if there are more columns to scroll right; False if at right edge of grid.
Declaration
public bool HasPartialVisibleCols { get; }
Property Value
Type |
---|
System.Boolean |
HasPartialVisibleRows
Gets a value indicating whether True if there are more rows to scroll down; False if at bottom of grid.
Declaration
public bool HasPartialVisibleRows { get; }
Property Value
Type |
---|
System.Boolean |
HscrollAreaBounds
Gets the horizontal scrollable area in client coordinates (including column headers).
Declaration
public Rectangle HscrollAreaBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
LastVisibleCol
Gets the last visible column.
Declaration
public int LastVisibleCol { get; }
Property Value
Type |
---|
System.Int32 |
LastVisibleRow
Gets the last visible row.
Declaration
public int LastVisibleRow { get; }
Property Value
Type |
---|
System.Int32 |
ScrollAreaBounds
Gets the scrollable area in client coordinates (excluding both column and row headers).
Declaration
public Rectangle ScrollAreaBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
ScrollCellsRange
Gets the current range of cells that is scrollable (all rows and columns excluding frozen rows and columns).
Declaration
public GridRangeInfo ScrollCellsRange { get; }
Property Value
Type |
---|
GridRangeInfo |
VisibleCellsRange
Gets the current visible range of cells.
Declaration
public GridRangeInfo VisibleCellsRange { get; }
Property Value
Type |
---|
GridRangeInfo |
VisibleCols
Gets the number of visible columns in the current view.
Declaration
public int VisibleCols { get; }
Property Value
Type |
---|
System.Int32 |
VisibleColumnsList
Gets a hash table where each entry consists of the absolute column index as key and relative column index as value. You can use this dictionary to quickly look up if a column is visible.
Declaration
public Hashtable VisibleColumnsList { get; }
Property Value
Type |
---|
System.Collections.Hashtable |
VisibleRows
Gets the number of visible rows in the current view.
Declaration
public int VisibleRows { get; }
Property Value
Type |
---|
System.Int32 |
VisibleRowsList
Gets a hash table where each entry consists of the absolute row index as key and relative row index as value. You can use this dictionary to quickly look up if a row is visible.
Declaration
public Hashtable VisibleRowsList { get; }
Property Value
Type |
---|
System.Collections.Hashtable |
VscrollAreaBounds
Gets the vertical scrollable area in client coordinates (including row headers).
Declaration
public Rectangle VscrollAreaBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
Methods
ClientRowColToPoint(Int32, Int32)
Returns the location of a cell specified with client row and column index.
Declaration
public Point ClientRowColToPoint(int row, int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | Row index. |
System.Int32 | col | Column index. |
Returns
Type | Description |
---|---|
System.Drawing.Point | Returns the location of a cell. |
Examples
This example shows how to get a point from a specified cell.
GridControl gridControl1;
Point point = this.gridControl1.ViewLayout.ClientRowColToPoint(5, 7);
Console.WriteLine("Point:" + point);
Dim gridControl1 As GridControl
Dim point As Point = Me.gridControl1.ViewLayout.ClientRowColToPoint(5, 7)
Console.WriteLine("Point:" & point)
ClientRowColToPoint(Int32, Int32, GridCellSizeKind)
Returns the location of a cell specified with client row and column index.
Declaration
public Point ClientRowColToPoint(int row, int col, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The client row index of the cell. |
System.Int32 | col | The client column index of the cell. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Point | The window point for the location (top-left corner) of the cell. |
Examples
This example shows how to get the point from the specified row and column index.
GridControl gridControl1;
Point point = this.gridControl1.ViewLayout.ClientRowColToPoint(5, 7,GridCellSizeKind.VisibleSize);
Console.WriteLine("Point:" + point);
Dim gridControl1 As GridControl
Dim point As Point = Me.gridControl1.ViewLayout.ClientRowColToPoint(5, 7,GridCellSizeKind.VisibleSize)
Console.WriteLine("Point:" & point)
ColIndexToVisibleClient(Int32)
Returns a visible client column index for a given absolute column index. If the column is left of the LeftColIndex, the client column index for the LeftColIndex is returned.
Declaration
public int ColIndexToVisibleClient(int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The absolute column index. |
Returns
Type | Description |
---|---|
System.Int32 | The client column index in the current visible grid view area. |
Examples
This example returns the visible client column index for a given absolute column index.
GridControl gridControl1;
int visibleClientCol = this.gridControl1.ViewLayout.ColIndexToVisibleClient(5);
Console.WriteLine("Visible client column index:" + visibleClientCol);
Dim gridControl1 As GridControl
Dim visibleClientCol As Integer = Me.gridControl1.ViewLayout.ColIndexToVisibleClient(5)
Console.WriteLine("Visible client column index:" & visibleClientCol)
ColIndexToVisibleClient(Int32, out Boolean)
Returns a visible client column index for a given absolute column index. If the column is left of the LeftColIndex, the client column index for the left column index is returned. If the column is to the right of the last visible column, the client column index the last visible column index is returned.
Declaration
public int ColIndexToVisibleClient(int col, out bool hidden)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The absolute column index. |
System.Boolean | hidden | A place holder that is set to True if the column index is left of the left column index and not a frozen column. |
Returns
Type | Description |
---|---|
System.Int32 | The client column index in the current visible grid view area. |
CombineSpannedRanges(GridRangeInfo)
Enlarges the specified range with any floating or covered ranges that intersect with the range.
Declaration
public GridRangeInfo CombineSpannedRanges(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The original range. |
Returns
Type | Description |
---|---|
GridRangeInfo | The enlarged range that contains the original range and any covered or floating cells ranges within the range. |
Dispose(Boolean)
Disposes the unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetClientColRangeWidth(Int32, Int32)
Returns the total width of a range of columns specified in client row indexes.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetClientColRangeWidth(int fromColIndex, int toColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | Start column index. |
System.Int32 | toColIndex | End column index. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total width of a range of columns |
Examples
This example shows how to get the range of client's column width from a specified column range.
GridControl gridControl1;
int rangeWidth = this.gridControl1.ViewLayout.GetClientColRangeWidth(4, 6);
Console.WriteLine("RangeWidth:" + rangeWidth);
Dim gridControl1 As GridControl
Dim rangeWidth1 As Integer = Me.gridControl1.ViewLayout.GetClientColRangeWidth(4, 6)
Console.WriteLine("RangeWidth:" & rangeWidth1)
GetClientColRangeWidth(Int32, Int32, GridCellSizeKind)
Returns the total width of a range of columns specified in client row indexes.
Declaration
public int GetClientColRangeWidth(int fromColIndex, int toColIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | The first client column index. |
System.Int32 | toColIndex | The last client column index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total width of the specified range of columns. |
GetClientColRangeWidth(Int32, Int32, Int32)
Returns the total width of a range of columns specified in client row indexes and aborts calculation if it is greater than a specified maximum value.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetClientColRangeWidth(int fromColIndex, int toColIndex, int maxSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | Index of from column. |
System.Int32 | toColIndex | Index of to column. |
System.Int32 | maxSize | Size of the maximum value. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total width of a range of columns. |
GetClientColRangeWidth(Int32, Int32, Int32, GridCellSizeKind)
Returns the total width of a range of columns specified in client row indexes and aborts calculation if it is greater than a specified maximum value.
Declaration
public int GetClientColRangeWidth(int fromColIndex, int toColIndex, int maxSize, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | The first client column index. |
System.Int32 | toColIndex | The last client column index. |
System.Int32 | maxSize | Aborts calculation if total width is greater than this specified maximum value. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total width of the specified range of columns. |
Examples
This example shows how to get the total width of a range of columns.
GridControl gridControl1;
this.gridControl1.Model.CoveredRanges.Add(GridRangeInfo.Cells(4, 2, 5, 3));
void gridControl1_CellClick(object sender, GridCellClickEventArgs e)
{
GridRangeInfo range;
if (this.gridControl1.Model.CoveredRanges.Find(e.RowIndex, e.ColIndex, out range))
{
int rangeWidth = this.gridControl1.ViewLayout.GetClientColRangeWidth(range.Left, range.Right, GridCellSizeKind.ActualSize);
Console.WriteLine("RangeWidth:" + rangeWidth);
}
}
Private gridControl1 As GridControl
Me.gridControl1.Model.CoveredRanges.Add(GridRangeInfo.Cells(4, 2, 5, 3))
void gridControl1_CellClick(Object sender, GridCellClickEventArgs e)
Dim range As GridRangeInfo
If Me.gridControl1.Model.CoveredRanges.Find(e.RowIndex, e.ColIndex, range) Then
Dim rangeWidth As Integer = Me.gridControl1.ViewLayout.GetClientColRangeWidth(range.Left, range.Right, GridCellSizeKind.ActualSize)
Console.WriteLine("RangeWidth:" & rangeWidth)
End If
GetClientColWidth(Int32)
Returns the column width of the column, reducing it by hScrollPixelDelta if is the column at LeftColIndex. When horizontal pixel scrolling is enabled, hScrollPixelDelta will be between 0 and the width of the column at LeftColIndex.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetClientColWidth(int clientColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | clientColIndex | Index of the client col. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the column width of the column |
Examples
This example shows how to get the column width of the specified column index.
GridControl gridControl1;
int colIndex = this.gridControl1.CurrentCell.ColIndex;
int colWidth = this.gridControl1.ViewLayout.GetClientColWidth(colIndex);
Console.WriteLine("ColumnWidth:" + colWidth);
Dim gridControl1 As GridControl
Dim colIndex As Integer = Me.gridControl1.CurrentCell.ColIndex
Dim colWidth As Integer = Me.gridControl1.ViewLayout.GetClientColWidth(colIndex)
Console.WriteLine("ColumnWidth:" & colWidth)
GetClientColWidth(Int32, GridCellSizeKind)
Returns the column width of the column, reducing it by hScrollPixelDelta if is the column at LeftColIndex. When horizontal pixel scrolling is enabled, hScrollPixelDelta will be between 0 and the width of the column at LeftColIndex.
Declaration
public int GetClientColWidth(int clientColIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | clientColIndex | The client column index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | Client column width. |
Examples
This example shows how to get the column width of the specified column index.
GridControl gridControl1;
int colIndex = this.gridControl1.CurrentCell.ColIndex;
int colWidth = this.gridControl1.ViewLayout.GetClientColWidth(colIndexGridCellSizeKind.ActualSize);
Console.WriteLine("ColumnWidth:" + colWidth);
Dim gridControl1 As GridControl
Dim colIndex As Integer = Me.gridControl1.CurrentCell.ColIndex
Dim colWidth As Integer = Me.gridControl1.ViewLayout.GetClientColWidth(colIndex,GridCellSizeKind.ActualSize)
Console.WriteLine("ColumnWidth:" & colWidth).
GetClientRowHeight(Int32)
Returns the row height of the row, reducing it by vScrollPixelDelta if is the row at TopRowIndex. When horizontal pixel scrolling is enabled, vScrollPixelDelta will be between 0 and the height of the row at TopRowIndex.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetClientRowHeight(int clientRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | clientRowIndex | Index of the client row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the row height of the row. |
GetClientRowHeight(Int32, GridCellSizeKind)
Returns the row height of the row, reducing it by vScrollPixelDelta if is the row at TopRowIndex. When horizontal pixel scrolling is enabled, vScrollPixelDelta will be between 0 and the height of the row at TopRowIndex.
Declaration
public int GetClientRowHeight(int clientRowIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | clientRowIndex | The client row index |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | Client row height. |
GetClientRowRangeHeight(Int32, Int32)
Returns the total height of a range of rows specified in client row indexes.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetClientRowRangeHeight(int fromRowIndex, int toRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | Index of from row. |
System.Int32 | toRowIndex | Index of to row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total height of a range of rows. |
GetClientRowRangeHeight(Int32, Int32, GridCellSizeKind)
Returns the total height of a range of rows specified in client row indexes.
Declaration
public int GetClientRowRangeHeight(int fromRowIndex, int toRowIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | The first client row index. |
System.Int32 | toRowIndex | The last client row index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total height of the specified range of rows. |
GetClientRowRangeHeight(Int32, Int32, Int32)
Returns the total height of a range of rows specified in client row indexes and aborts calculation if it is greater than a specified maximum value.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetClientRowRangeHeight(int fromRowIndex, int toRowIndex, int maxSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | Index of from row. |
System.Int32 | toRowIndex | Index of to row. |
System.Int32 | maxSize | Size of the max. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total height of a range of rows |
GetClientRowRangeHeight(Int32, Int32, Int32, GridCellSizeKind)
Returns the total height of a range of rows specified in client row indexes and aborts calculation if it is greater than a specified maximum value.
Declaration
public int GetClientRowRangeHeight(int fromRowIndex, int toRowIndex, int maxSize, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | The first client row index. |
System.Int32 | toRowIndex | The last client row index. |
System.Int32 | maxSize | Aborts calculation if total height is greater than this specified maximum value. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total height of the specified range of rows. |
GetColRangeWidth(Int32, Int32)
Returns the total width of a range of columns.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetColRangeWidth(int fromColIndex, int toColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | Index of from col. |
System.Int32 | toColIndex | Index of to col. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total width of a range of columns |
GetColRangeWidth(Int32, Int32, GridCellSizeKind)
Returns the total width of a range of columns.
Declaration
public int GetColRangeWidth(int fromColIndex, int toColIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | The first column index. |
System.Int32 | toColIndex | The last column index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total width of the specified range of columns. |
Remarks
Column widths are determined with GetColWidth(Int32).
GetColRangeWidth(Int32, Int32, Int32)
Returns the total width of a range of columns and aborts calculation if it is greater than a specified maximum value.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetColRangeWidth(int fromColIndex, int toColIndex, int maxSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | Index of from col. |
System.Int32 | toColIndex | Index of to col. |
System.Int32 | maxSize | Size of the max. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total width of a range of columns |
GetColRangeWidth(Int32, Int32, Int32, GridCellSizeKind)
Returns the total width of a range of columns and aborts calculation if it is greater than a specified maximum value.
Declaration
public int GetColRangeWidth(int fromColIndex, int toColIndex, int maxSize, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | The first column index. |
System.Int32 | toColIndex | The last column index. |
System.Int32 | maxSize | Aborts calculation if total width is greater than this specified maximum value. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total width of the specified range of columns. |
Remarks
Column widths are determined with GetColWidth(Int32).
GetColWidth(Int32)
Returns the column width of the column, reducing it by hScrollPixelDelta if is the column at LeftColIndex. When horizontal pixel scrolling is enabled hScrollPixelDelta will be between 0 and the width of the column at LeftColIndex.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetColWidth(int absoluteColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | absoluteColIndex | Index of the absolute col. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the column width of the column |
GetColWidth(Int32, GridCellSizeKind)
Returns the column width of the column, reducing it by hScrollPixelDelta if is the column at LeftColIndex. When horizontal pixel scrolling is enabled, hScrollPixelDelta will be between 0 and the width of the column at LeftColIndex.
Declaration
public int GetColWidth(int absoluteColIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | absoluteColIndex | The absolute column index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | Column width. |
GetColWidths(Int32, Int32)
Returns a one-dimensional array with ints filled with values determined from GetColWidth(Int32).
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int[] GetColWidths(int fromColIndex, int toColIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromColIndex | Index of from col. |
System.Int32 | toColIndex | Index of to col. |
Returns
Type | Description |
---|---|
System.Int32[] | Returns a one-dimensional array with ints from GetColWidth(Int32). |
GetRowHeight(Int32)
Returns the row height of the row, reducing it by vScrollPixelDelta if is the row at TopRowIndex. When horizontal pixel scrolling is enabled, vScrollPixelDelta will be between 0 and the height of the row at TopRowIndex.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetRowHeight(int absoluteRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | absoluteRowIndex | Index of the absolute row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the row height of the row |
Examples
This example shows how to get the height of a row with the given row index.
GridControl gridControl1;
int rowIndex = this.gridControl1.CurrentCell.RowIndex;
int rowHeight = this.gridControl1.ViewLayout.GetRowHeight(rowIndex);
Console.WriteLine("RowHeight:" + rowHeight);
Dim gridControl1 As GridControl
Dim rowIndex As Integer = Me.gridControl1.CurrentCell.RowIndex
Dim rowHeight As Integer = Me.gridControl1.ViewLayout.GetRowHeight(rowIndex)
Console.WriteLine("RowHeight:" & rowHeight)
GetRowHeight(Int32, GridCellSizeKind)
Returns the row height of the row, reducing it by vScrollPixelDelta if is the row at TopRowIndex. When horizontal pixel scrolling is enabled, vScrollPixelDelta will be between 0 and the height of the row at TopRowIndex.
Declaration
public int GetRowHeight(int absoluteRowIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | absoluteRowIndex | The absolute row index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | Row height. |
Examples
This example shows how to get the height of a row with the given row index, considering the top-row index.
GridControl gridControl1;
int rowIndex = this.gridControl1.CurrentCell.RowIndex;
int rowHeight = this.gridControl1.ViewLayout.GetRowHeight(rowIndex,GridCellSizeKind.VisibleSize);
Console.WriteLine("RowHeight:" + rowHeight);
Dim gridControl1 As GridControl
Dim rowIndex As Integer = Me.gridControl1.CurrentCell.RowIndex
Dim rowHeight As Integer = Me.gridControl1.ViewLayout.GetRowHeight(rowIndex,GridCellSizeKind.VisibleSize)
Console.WriteLine("RowHeight:" & rowHeight)
GetRowHeights(Int32, Int32)
Returns a one-dimensional array with ints filled with values determined from GetRowHeight(Int32).
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int[] GetRowHeights(int fromRowIndex, int toRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | Index of from row. |
System.Int32 | toRowIndex | Index of to row. |
Returns
Type | Description |
---|---|
System.Int32[] | Returns a one-dimensional array with ints from GetRowHeight(Int32). |
Examples
This example shows how to get the row heights in a array.
GridControl gridControl1;
int[] rowHeight = this.gridControl1.ViewLayout.GetRowHeights(4, 6);
for (int i = 0; i <3;i++ )
Console.WriteLine("RowHeights:" + rowHeight[i]);
Dim gridControl1 As GridControl
Dim rowHeight() As Integer = Me.gridControl1.ViewLayout.GetRowHeights(4, 6)
For i As Integer = 0 To 2
Console.WriteLine("RowHeights:" & rowHeight(i))
Next i
GetRowHeights(Int32, Int32, GridCellSizeKind)
Returns a one-dimensional array with ints filled with values determined from GetRowHeight(Int32).
Declaration
public int[] GetRowHeights(int fromRowIndex, int toRowIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | The first row index. |
System.Int32 | toRowIndex | The last row index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32[] | The array with row heights. |
Examples
This example shows how to get the row heights specified row index in a array values.
GridControl gridControl1;
int[] rowHeight = this.gridControl1.ViewLayout.GetRowHeights(4, 6, GridCellSizeKind.ActualSize);
for (int i = 0; i <3;i++ )
Console.WriteLine("RowHeights:" + rowHeight[i]);
Dim gridControl1 As GridControl
Dim rowHeight() As Integer = Me.gridControl1.ViewLayout.GetRowHeights(4, 6, GridCellSizeKind.ActualSize)
For i As Integer = 0 To 2
Console.WriteLine("RowHeights:" & rowHeight(i))
Next i
GetRowRangeHeight(Int32, Int32)
Returns the total height of a range of rows.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetRowRangeHeight(int fromRowIndex, int toRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | Index of from row. |
System.Int32 | toRowIndex | Index of to row. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total height of a range of rows |
Examples
This example shows how to get the row height of a specified range of rows.
GridControl gridControl1;
int rowHeight = this.gridControl1.ViewLayout.GetRowRangeHeight(4, 6);
Console.WriteLine("RowHeights:" + rowHeight);
Dim gridControl1 As GridControl
Dim rowHeight As Integer = Me.gridControl1.ViewLayout.GetRowRangeHeight(4, 6)
Console.WriteLine("RowHeights:" & rowHeight)
GetRowRangeHeight(Int32, Int32, GridCellSizeKind)
Returns the total height of a range of rows.
Declaration
public int GetRowRangeHeight(int fromRowIndex, int toRowIndex, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | The first row index. |
System.Int32 | toRowIndex | The last row index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total height of the specified range of rows. |
Remarks
Row heights are determined with GetRowHeight(Int32).
Examples
This example shows how to get the specified row height of a range of rows.
GridControl gridControl1;
int rowHeight = this.gridControl1.ViewLayout.GetRowRangeHeight(4, 6, GridCellSizeKind.VisibleSize);
Console.WriteLine("RowHeights:" + rowHeight);
Dim gridControl1 As GridControl
Dim rowHeight As Integer = Me.gridControl1.ViewLayout.GetRowRangeHeight(4, 6, GridCellSizeKind.VisibleSize)
Console.WriteLine("RowHeights:" & rowHeight)
GetRowRangeHeight(Int32, Int32, Int32)
Returns the total height of a range of rows and aborts calculation if it is greater than a specified maximum value.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int GetRowRangeHeight(int fromRowIndex, int toRowIndex, int maxSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | Index of from row. |
System.Int32 | toRowIndex | Index of to row. |
System.Int32 | maxSize | Size of the max. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the total height of a range of rows |
GetRowRangeHeight(Int32, Int32, Int32, GridCellSizeKind)
Returns the total height of a range of rows and aborts calculation if it is greater than a specified maximum value.
Declaration
public int GetRowRangeHeight(int fromRowIndex, int toRowIndex, int maxSize, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fromRowIndex | The first row index. |
System.Int32 | toRowIndex | The last row index. |
System.Int32 | maxSize | Aborts calculation if total height is greater than this specified maximum value. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Int32 | The total height of the specified range of rows. |
Remarks
Row heights are determined with GetRowHeight(Int32).
IsColVisible(Int32)
Determines if the column specified with an absolute column index is visible.
Declaration
public bool IsColVisible(int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The absolute column index specifying the column to be tested. |
Returns
Type | Description |
---|---|
System.Boolean | true if visible; false if outside visible area |
IsRangeVisible(GridRangeInfo)
Determines if parts of the range specified with an absolute row and column indexes are visible.
Declaration
public bool IsRangeVisible(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be tested. |
Returns
Type | Description |
---|---|
System.Boolean | True if visible; False if outside visible area. |
IsRowVisible(Int32)
Determines if the row specified with an absolute row index is visible.
Declaration
public bool IsRowVisible(int row)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The absolute row index specifying the row to be tested. |
Returns
Type | Description |
---|---|
System.Boolean | True if visible; False if outside visible area. |
Lock()
Prevent subsequent calls to Reset() method from clearing the layout information. Use this if you want to optimize Invalidate / Update calls.
Declaration
public void Lock()
Examples
Updates a single cell and avoids ViewLayout being reinitialized.
this.gridControl1.ViewLayout.Lock();
GridRangeInfo cell = GridRangeInfo.Cell(row, col);
Rectangle bounds = gridControl1.RangeInfoToRectangle(cell);
this.gridControl1.Invalidate(bounds);
this.gridControl1.Update();
this.gridControl1.ViewLayout.Unlock();
PointToClientCol(Point)
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int PointToClientCol(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type |
---|
System.Int32 |
PointToClientCol(Point, GridCellSizeKind)
Declaration
public int PointToClientCol(Point pt, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | |
GridCellSizeKind | sizeKind |
Returns
Type |
---|
System.Int32 |
PointToClientCol(Point, Boolean)
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int PointToClientCol(Point pt, bool fixBackHidden)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | |
System.Boolean | fixBackHidden |
Returns
Type |
---|
System.Int32 |
PointToClientCol(Point, Boolean, GridCellSizeKind)
Declaration
public int PointToClientCol(Point pt, bool fixBackHidden, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | |
System.Boolean | fixBackHidden | |
GridCellSizeKind | sizeKind |
Returns
Type |
---|
System.Int32 |
PointToClientRow(Point)
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int PointToClientRow(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type |
---|
System.Int32 |
PointToClientRow(Point, GridCellSizeKind)
Declaration
public int PointToClientRow(Point pt, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | |
GridCellSizeKind | sizeKind |
Returns
Type |
---|
System.Int32 |
PointToClientRow(Point, Boolean)
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when VScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public int PointToClientRow(Point pt, bool fixBackHidden)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | |
System.Boolean | fixBackHidden |
Returns
Type |
---|
System.Int32 |
PointToClientRow(Point, Boolean, GridCellSizeKind)
Declaration
public int PointToClientRow(Point pt, bool fixBackHidden, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | |
System.Boolean | fixBackHidden | |
GridCellSizeKind | sizeKind |
Returns
Type |
---|
System.Int32 |
PointToClientRowCol(Point, out Int32, out Int32, Boolean)
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public void PointToClientRowCol(Point point, out int row, out int col, bool fixBackHidden)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point | |
System.Int32 | row | |
System.Int32 | col | |
System.Boolean | fixBackHidden |
PointToClientRowCol(Point, out Int32, out Int32, Boolean, GridCellSizeKind)
Declaration
public void PointToClientRowCol(Point point, out int row, out int col, bool fixBackHidden, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point | |
System.Int32 | row | |
System.Int32 | col | |
System.Boolean | fixBackHidden | |
GridCellSizeKind | sizeKind |
RangeInfoToRectangle(GridRangeInfo)
Calculates the display area for a given range of cells with cell coordinates specified in absolute row and column indexes.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public Rectangle RangeInfoToRectangle(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | Returns the display area for a given range of cells with cell coordinates specified in absolute row and column indexes. |
Examples
This example shows how to get the rectangle from the given range.
GridRangeInfo range;
//Get the range of cells.
this.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, out range);
Rectangle rectangle = this.gridControl1.ViewLayout.RangeInfoToRectangle(range);
Dim range As GridRangeInfo
'Get the range of cells.
Me.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, range)
Dim rectangle As Rectangle = Me.gridControl1.ViewLayout.RangeInfoToRectangle(range)
RangeInfoToRectangle(GridRangeInfo, GridCellSizeKind)
Calculates the display area for a given range of cells with cell coordinates specified in absolute row and column indexes.
Declaration
public Rectangle RangeInfoToRectangle(GridRangeInfo range, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The GridRangeInfo with the range of cells. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A System.Drawing.Rectangle that spans the range of visible cells. If no cells in the given range are visible, System.Drawing.Rectangle.Empty is returned. |
Remarks
If there are covered cells or floating cells, they will treated as regular cells. The range is not enlarged to fit these spanned cells.
Examples
This example shows how to get the rectangle from a given range and considering the top-most row.
GridRangeInfo range;
//Get the range of cells.
this.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, out range);
Rectangle rectangle = this.gridControl1.ViewLayout.RangeInfoToRectangle(rangeGridCellSizeKind.ActualSize);
Dim range As GridRangeInfo
'Get the range of cells.
Me.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, range)
Dim rectangle As Rectangle = Me.gridControl1.ViewLayout.RangeInfoToRectangle(range,GridCellSizeKind.ActualSize)
RangeInfoToRectangle(GridRangeInfo, Boolean)
Calculates the display area for a given range of cells with cell coordinates specified in absolute row and column indexes.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public Rectangle RangeInfoToRectangle(GridRangeInfo range, bool ignoreOutsideClientRectangle)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range. |
System.Boolean | ignoreOutsideClientRectangle | if set to |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | Returns the display area for a given range of cells |
Examples
This example shows how to get the rectangle with the given range and considering the outside client rectangle.
GridRangeInfo range;
//Get the range of cells.
this.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, out range);
//True if the grid should only return points within the grid area.
Rectangle rectangle = this.gridControl1.ViewLayout.RangeInfoToRectangle(range,true);
Dim range As GridRangeInfo
'Get the range of cells.
Me.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, range)
'True if the grid should only return points within the grid area.
Dim rectangle As Rectangle = Me.gridControl1.ViewLayout.RangeInfoToRectangle(range,True)
RangeInfoToRectangle(GridRangeInfo, Boolean, GridCellSizeKind)
Calculates the display area for a given range of cells with cell coordinates specified in absolute row and column indexes.
Declaration
public Rectangle RangeInfoToRectangle(GridRangeInfo range, bool ignoreOutsideClientRectangle, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The GridRangeInfo with the range of cells. |
System.Boolean | ignoreOutsideClientRectangle | Set this True if the grid should only return points within the grid area; False if the method should calculate cells that are below or right of the visible area. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A System.Drawing.Rectangle that spans the range of visible cells. If no cells in the given range are visible, System.Drawing.Rectangle.Empty is returned. |
Examples
This example shows how to get the rectangle with the given range, considering the top row index.
GridRangeInfo range;
//Get the range of cells.
this.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, out range);
//True if the grid should only return points within the grid area.
Rectangle rectangle = this.gridControl1.ViewLayout.RangeInfoToRectangle(range,true,GridCellSizeKind.ActualSize);
Dim range As GridRangeInfo
'Get the range of cells.
Me.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, range)
'True if the grid should only return points within the grid area.
Dim rectangle As Rectangle = Me.gridControl1.ViewLayout.RangeInfoToRectangle(range,True,GridCellSizeKind.ActualSize)
RectangleBottomOfRow(Int32)
Returns the control region below an absolute row index.
Declaration
public Rectangle RectangleBottomOfRow(int row)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | Row index. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | Rectanlge region below the specified row index. |
RectangleBottomOfRow(Int32, GridCellSizeKind)
Returns the control region below an absolute row index. The passed-in row is included in the rectangle.
Declaration
public Rectangle RectangleBottomOfRow(int row, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The absolute row index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The window region that is below the specified row. |
RectangleRightOfCol(Int32)
Returns the control region right (RTL: left) of an absolute column index.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public Rectangle RectangleRightOfCol(int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The col index. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | returns the control region right (RTL: left) of an absolute column index. |
RectangleRightOfCol(Int32, GridCellSizeKind)
Returns the control region right (RTL: left) of a absolute column index. The passed-in column is included in the rectangle.
Declaration
public Rectangle RectangleRightOfCol(int col, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The absolute column index. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The window region that is right of the specified column. |
RectangleToClientRowCol(Rectangle, out Int32, out Int32, out Int32, out Int32)
Returns client row and column indexes under a window rectangle.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public void RectangleToClientRowCol(Rectangle rect, out int topRow, out int leftCol, out int bottomRow, out int rightCol)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rect | |
System.Int32 | topRow | |
System.Int32 | leftCol | |
System.Int32 | bottomRow | |
System.Int32 | rightCol |
Examples
This example shows how to Get the client row and column from the given rectangle.
GridRangeInfo range;
int topRow,leftCol,bottomRow,rightCol;
//Get the range of cell.
this.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, out range);
//Get the bounds of the cell.
Rectangle rectangle = this.gridControl1.ViewLayout.RangeInfoToRectangle(range);
this.gridControl1.ViewLayout.RectangleToClientRowCol(rectangle,out topRow,out leftCol,out bottomRow,out rightCol,GridCellSizeKind.ActualSize);
Dim range As GridRangeInfo
Dim topRow, leftCol, bottomRow, rightCol As Integer
'Get the range of cell.
Me.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, range)
'Get the bounds of the cell.
Dim rectangle As Rectangle = Me.gridControl1.ViewLayout.RangeInfoToRectangle(range)
Me.gridControl1.ViewLayout.RectangleToClientRowCol(rectangle,topRow,leftCol,bottomRow,rightCol,GridCellSizeKind.ActualSize)
RectangleToClientRowCol(Rectangle, out Int32, out Int32, out Int32, out Int32, GridCellSizeKind)
Returns client row and column indexes under a window rectangle.
Declaration
public void RectangleToClientRowCol(Rectangle rect, out int topRow, out int leftCol, out int bottomRow, out int rightCol, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rect | The window region for which your client row and columns should be determined. |
System.Int32 | topRow | A place holder where the upper client row index is returned. |
System.Int32 | leftCol | A place holder where the left (RTL: right) client column index is returned. |
System.Int32 | bottomRow | A place holder where the bottom client row index is returned. |
System.Int32 | rightCol | A place holder where the right (RTL: left) client column index is returned. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Examples
This example how to get the rectangle of the client row and column.
GridRangeInfo range;
int topRow,leftCol,bottomRow,rightCol;
//Get the range of cell.
this.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, out range);
//Get the bounds of the cell.
Rectangle rectangle = this.gridControl1.ViewLayout.RangeInfoToRectangle(range);
this.gridControl1.ViewLayout.RectangleToClientRowCol(rectangle,out topRow,out leftCol,out bottomRow,out rightCol,GridCellSizeKind.ActualSize);
Dim range As GridRangeInfo
Dim topRow, leftCol, bottomRow, rightCol As Integer
'Get the range of cell.
Me.gridControl1.Model.GetSpannedRangeInfo(e.RowIndex, e.ColIndex, range)
'Get the bounds of the cell.
Dim rectangle As Rectangle = Me.gridControl1.ViewLayout.RangeInfoToRectangle(range)
Me.gridControl1.ViewLayout.RectangleToClientRowCol(rectangle,topRow,leftCol,bottomRow,rightCol,GridCellSizeKind.ActualSize)
Reset()
Call this method when layout information needs to be refreshed.
Declaration
public void Reset()
RowColToPoint(Int32, Int32)
Returns the location of a cell specified with absolute row and column index.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public Point RowColToPoint(int row, int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The row index. |
System.Int32 | col | The col index. |
Returns
Type | Description |
---|---|
System.Drawing.Point | Returns the location of a cell. |
Examples
This example shows how to get the point from the specified row and column index.
Point point = this.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex);
Console.Write("Location:" + point);
Dim point As Point = Me.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex)
Console.Write("Location:" & point)
RowColToPoint(Int32, Int32, GridCellSizeKind)
Returns the location of a cell specified with absolute row and column index.
Declaration
public Point RowColToPoint(int row, int col, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The absolute row index of the cell. |
System.Int32 | col | The absolute column index of the cell. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Point | The window point for the location (top-left corner) of the cell. |
Examples
This example shows how to get the point from a specified row and column index.
Point point = this.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex,GridCellSizeKind.ActualSize);
Console.Write("Location:" + point);
Dim point As Point = Me.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex,GridCellSizeKind.ActualSize)
Console.Write("Location:" & point)
RowColToPoint(Int32, Int32, Boolean)
Returns the location of a cell specified with absolute row and column index.
Declaration
[Obsolete("It is recommended that the sizeKind parameter is specified for pixel scrolling (when HScrollPixel = true). GridCellSizeKind.ActualSize is specified as default.")]
public Point RowColToPoint(int row, int col, bool ignoreOutsideClientRectangle)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The row index. |
System.Int32 | col | The col index. |
System.Boolean | ignoreOutsideClientRectangle | if set to |
Returns
Type | Description |
---|---|
System.Drawing.Point | Returns the location of a cell specified with absolute row and column index |
Examples
This example shows how to get the point from a specified row and column index.
//set ignoreOutsideClientRectangle to True, if the grid should only return points within the grid area
Point point = this.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex,true);
Console.Write("Location:" + point);
'set ignoreOutsideClientRectangle to True, if the grid should only return points within the grid area
Dim point As Point = Me.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex,True)
Console.Write("Location:" & point)
RowColToPoint(Int32, Int32, Boolean, GridCellSizeKind)
Returns the location of a cell specified with absolute row and column index.
Declaration
public Point RowColToPoint(int row, int col, bool ignoreOutsideClientRectangle, GridCellSizeKind sizeKind)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The absolute row index of the cell. |
System.Int32 | col | The absolute column index of the cell. |
System.Boolean | ignoreOutsideClientRectangle | Set this True if the grid should only return points within the grid area; False if the method should calculate cells that are below or right of the visible area. |
GridCellSizeKind | sizeKind | Specifies how to handle the top-most row or left-most (RTL: right-most) column when pixel scrolling is enabled and cells are only partially visible. |
Returns
Type | Description |
---|---|
System.Drawing.Point | The window point for the location (top-left corner / RTL: top-right) of the cell. |
Examples
This example shows how to get a point from the specified row and column index.
//set ignoreOutsideClientRectangle to True, if the grid should only return points within the grid area
Point point = this.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex,true,GridCellSizeKind.ActualSize);
Console.Write("Location:" + point);
'set ignoreOutsideClientRectangle to True, if the grid should only return points within the grid area
Dim point As Point = Me.gridControl1.ViewLayout.RowColToPoint(e.RowIndex, e.ColIndex,True,GridCellSizeKind.ActualSize)
Console.Write("Location:" & point)
RowIndexToVisibleClient(Int32)
Returns a visible client row index for a given absolute row index. If the row is above the top row, the client row index for the top row index is returned.
Declaration
public int RowIndexToVisibleClient(int row)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The absolute row index. |
Returns
Type | Description |
---|---|
System.Int32 | The client row index in the current visible grid view area. |
RowIndexToVisibleClient(Int32, out Boolean)
Returns a visible client row index for a given absolute row index. If the row is above the top row, the client row index for the top row index is returned. If the row is below the last visible row, the client row index the last visible row index is returned.
Declaration
public int RowIndexToVisibleClient(int row, out bool hidden)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The absolute row index. |
System.Boolean | hidden | A place holder that is set to True if the row index is above the top row and not a frozen row. |
Returns
Type | Description |
---|---|
System.Int32 | The client row index in the current visible grid view area. |
Unlock()
Restores correct Reset() method behavior after a call to Lock() was made. See Lock() for a C# example.
Declaration
public void Unlock()
VisitVisibleCells(GridRangeInfo, GridRowColRangeInfoHandler[])
Executes a delegate for every cell in the specified range that is visible in the current grid view.
Declaration
public GridRangeInfo VisitVisibleCells(GridRangeInfo range, GridRowColRangeInfoHandler[] handler)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range that specifies the cells to visit. |
GridRowColRangeInfoHandler[] | handler | This delegate represents the method to execute for every visible cell in the specified range. |
Returns
Type | Description |
---|---|
GridRangeInfo | The outer range that contains all ranges returned by executing |
Events
LayoutChanged
Occurs when layout information has been changed or reinitialized.
Declaration
public event EventHandler LayoutChanged
Event Type
Type |
---|
System.EventHandler |