|
Author: Jenny Nguyen
|
|
The default keyboard navigation setting for the XtraTreeList control is to hold the Control key with the left or right key to navigate the treelist. protected internal void tlFuncLoc_KeyDown(object sender, KeyEventArgs e) { TreeList tl = sender as TreeList; if (tl.FocusedNode == null) return; if (e.Control) { if (tl.FocusedColumn == null) return; int idx = tl.FocusedColumn.VisibleIndex; if (e.KeyCode == Keys.Left) { if (idx > 0) tl.FocusedColumn = tl.GetColumnByVisibleIndex(idx - 1); e.Handled = true; } else if (e.KeyCode == Keys.Right) { DevExpress.XtraTreeList.Columns.TreeListColumn col = tl.GetColumnByVisibleIndex(idx + 1); if (col != null) tl.FocusedColumn = col; e.Handled = true; } } else { if (e.KeyCode == Keys.Left) { tl.FocusedNode.Expanded = false; e.Handled = true; } else if (e.KeyCode == Keys.Right) { tl.FocusedNode.Expanded = true; e.Handled = true; } } }
|