We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDirectionType confusion

Thread ID:

Created:

Updated:

Platform:

Replies:

13075 Apr 20,2004 03:47 AM UTC Apr 20,2004 04:08 AM UTC Windows Forms 1
loading
Tags: GridControl
Sue Harris
Asked On April 20, 2004 03:47 AM UTC

I''m trying to work around disabled cells in my grid. However, I''ve run into a problem when I''m in the last column of a row, and the cell in the next row (last column) is disabled. In the QueryNextCurrentCellPosition, instead of the GridDirectionType.Right that I expect to get, I get Down. (Sample attached). As a result, the next cell jumps a row. Does anyone have any suggestions how I can detect this situation and hence fix the movement? Thanks, Sue forum_wrapping1_4128.zip

Administrator [Syncfusion]
Replied On April 20, 2004 04:08 AM UTC

Hi Sue, you can use the MoveCurrentCellDirection event instead: private void gridControl1_MoveCurrentCellDirection(object sender, GridMoveCurrentCellDirectionEventArgs e) { GridControlBase grid = sender as GridControlBase; GridModel gridModel = grid.Model; int row = e.RowIndex; int col = e.ColIndex; switch (e.Direction) { case GridDirectionType.Right: { col++; if (col > gridModel.ColCount) { row++; col = grid.LeftColIndex; } while (row < gridModel.RowCount) { using (GridStyleInfo style = grid.GetViewStyleInfo(row, col)) { if (style.Enabled) { e.Result = grid.CurrentCell.MoveTo(row, col); e.Handled = true; return; } col++; if (col > gridModel.ColCount) { row++; col = grid.LeftColIndex; } } } e.Handled = true; e.Result = false; break; } case GridDirectionType.Left: { col--; if (col == gridModel.Cols.HeaderCount) { row--; col = gridModel.ColCount; } while (row > gridModel.Rows.HeaderCount) { using (GridStyleInfo style = grid.GetViewStyleInfo(row, col)) { if (style.Enabled) { e.Result = grid.CurrentCell.MoveTo(row, col); e.Handled = true; return; } col--; if (col == gridModel.Cols.HeaderCount) { row--; col = gridModel.ColCount; } } } e.Handled = true; e.Result = false; break; } } } I attached a sample Stefan WrapRow_2779.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;