private static void SetCurrentColumnAndChangeSelection(DataGridContext dataGridContext, ColumnBase column) { Debug.Assert(dataGridContext != null); Debug.Assert(column != null); try { dataGridContext.SetCurrentColumnAndChangeSelection(column); } catch (DataGridException) { // We swallow the exception if it occurs because of a validation error or Cell was read-only or // any other GridException. } }
internal static void ProcessEndKey( DataGridContext dataGridContext ) { ReadOnlyColumnCollection visibleColumnsCollection = ( ReadOnlyColumnCollection )dataGridContext.VisibleColumns; int visibleColumnsCount = visibleColumnsCollection.Count; // Set the CurrentColumn only if there are VisibleColumns if( visibleColumnsCount > 0 ) { int lastVisiblefocusableColumnIndex = DataGridScrollViewer.GetLastVisibleFocusableColumnIndex( dataGridContext ); if( lastVisiblefocusableColumnIndex >= 0 ) { try { dataGridContext.SetCurrentColumnAndChangeSelection( visibleColumnsCollection[ lastVisiblefocusableColumnIndex ] ); } catch( DataGridException ) { // We swallow the exception if it occurs because of a validation error or Cell was read-only or // any other GridException. } } } }
private static void SetCurrentColumnAndChangeSelection( DataGridContext dataGridContext, ColumnBase column ) { Debug.Assert( dataGridContext != null ); Debug.Assert( column != null ); try { dataGridContext.SetCurrentColumnAndChangeSelection( column ); } catch( DataGridException ) { // We swallow the exception if it occurs because of a validation error or Cell was read-only or // any other GridException. } }