47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using DevExpress.XtraGrid.Views.Grid;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Lskj.PubPower
|
|
{
|
|
public static class GridExtend
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置GridView选中行</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-05 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="gridView">The grid view.</param>
|
|
/// <param name="handler">The handle.</param>
|
|
public static void SelectRowHandler(this GridView gridView, int handle)
|
|
{
|
|
if (gridView.OptionsSelection.MultiSelect == true && gridView.OptionsSelection.EnableAppearanceFocusedCell == false && gridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.RowSelect)
|
|
{
|
|
if (handle != 0)
|
|
{
|
|
gridView.ClearSelection();
|
|
gridView.FocusedRowHandle = handle;
|
|
gridView.SelectRow(handle);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (handle < 0) handle = 0;
|
|
gridView.ClearSelection();
|
|
gridView.FocusedRowHandle = handle;
|
|
gridView.SelectRow(handle);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|