public bool EditEntity(int rowHandle) { var entity = view.GetRow(rowHandle) as TEntity; if (entity != null && viewModel.CanEdit(entity)) { viewModel.Edit(entity); return(true); } return(false); }