GrapeCity MultiRow Windows Forms Documentation
Current Row

The row in which the user is working is called the current row. You can write code independent of the row index if you reference the rows through the current row. You can access the current row by using the GcMultiRow.CurrentRow property.

Retrieving the Current Row Index

You can retrieve the current row index using the GcMultiRow.CurrentCellPosition.RowIndex property.

Using Code

This example gets the current row index.

[VB]

Console.WriteLine("Current row index: {0}", GcMultiRow1.CurrentCellPosition.RowIndex)

[CS]

Console.WriteLine("Current row index: {0}", gcMultiRow1.CurrentCellPosition.RowIndex);

Moving the Current Row

To move the current row, set a new row position in the GcMultiRow.CurrentCellPosition property.

Using Code

This example moves the current row.

[VB]

GcMultiRow1.CurrentCellPosition = New GrapeCity.Win.MultiRow.CellPosition(1, 0)

[CS]

gcMultiRow1.CurrentCellPosition = new GrapeCity.Win.MultiRow.CellPosition(1, 0);

Accessing Cells in the Current Row

You can access the cells in the current row using the Row.Cells property.

Using Code

This example gets the current cell index.

[VB]

Imports GrapeCity.Win.MultiRow

For Each cell As Cell In GcMultiRow1.CurrentRow.Cells
    Console.WriteLine("Cell index: {0}", cell.CellIndex)
Next

[CS]

using GrapeCity.Win.MultiRow;

foreach (Cell cell in gcMultiRow1.CurrentRow.Cells)
{
    Console.WriteLine("Cell index: {0}", cell.CellIndex);
}

If the current row does not exist, the GcMultiRow.CurrentRow property returns a null reference (Nothing in Visual Basic). For example, when the template is not set in the GcMultiRow control or when the GcMultiRow control is in Display mode (GcMultiRow.ViewMode=Display).

Displaying Indicators

For information about displaying the indicator in the current row, see Using Row Headers.

Border

Use the GcMultiRow.CurrentRowBorderLine property to set the border style for the current row.

Using Code

This example sets the CurrentRowBorderLine property.

[VB]

GcMultiRow1.CurrentRowBorderLine = New GrapeCity.Win.MultiRow.Line(GrapeCity.Win.MultiRow.LineStyle.Medium, Color.Red)

[CS]

gcMultiRow1.CurrentRowBorderLine = new GrapeCity.Win.MultiRow.Line(GrapeCity.Win.MultiRow.LineStyle.Medium, Color.Red);
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options