本文整理汇总了C#中DataGridContext.SetCurrentColumnAndChangeSelection方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridContext.SetCurrentColumnAndChangeSelection方法的具体用法?C# DataGridContext.SetCurrentColumnAndChangeSelection怎么用?C# DataGridContext.SetCurrentColumnAndChangeSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataGridContext
的用法示例。
在下文中一共展示了DataGridContext.SetCurrentColumnAndChangeSelection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessEndKey
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.
}
}
}
}
示例2: SetCurrentColumnAndChangeSelection
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.
}
}