GridView设置焦点到Cell

时间:2021-07-21 15:21:36
         /// <summary>
/// 设置焦点到Cell
/// </summary>
/// <param name="view"></param>
/// <param name="rowHandle"></param>
/// <param name="columnIndex"></param>
protected virtual void SetFocused(GridView view, Int32 rowHandle, Int32 columnIndex)
{
view.Focus();
view.FocusedRowHandle = rowHandle;
if (view.Columns.Count > columnIndex)
{
view.FocusedColumn = view.Columns[columnIndex];
}
view.ShowEditor();
}
protected virtual void SetFocused(GridView view, Int32 rowHandle, string columnName)
{
view.Focus();
view.FocusedRowHandle = rowHandle;
view.FocusedColumn = view.Columns[columnName];
view.ShowEditor();
}