了解了,这个功能很好实现。
在MultiRow下面放上一排Button或者Label,然后在他们的Click中写代码处理就行了:
"|<" : SelectionActions.MoveToFirstRow.Execute(this.gcMultiRow1);
"<" : SelectionActions.MoveToPreviousRow.Execute(this.gcMultiRow1);
">" : SelectionActions.MoveToNextRow.Execute(this.gcMultiRow1);
">|" : SelectionActions.MoveToLastRow.Execute(this.gcMultiRow1);
用Label来显示当前行/总行数:
MultiRow的总行数:gcMultiRow1.RowCount
当前在哪一行:this.gcMultiRow1.CurrentCellPosition.RowIndex
用TextBox来设置当前行:
int rowIndex;
if (int.TryParse(this.textBox1.Text, out rowIndex))
{
if (rowIndex >= 0 && rowIndex < this.gcMultiRow1.RowCount)
{
this.gcMultiRow1.CurrentCellPosition = new CellPosition(rowIndex, this.gcMultiRow1.CurrentCellPosition.CellIndex);
}
} |