本文整理汇总了C#中GridControl.Select方法的典型用法代码示例。如果您正苦于以下问题:C# GridControl.Select方法的具体用法?C# GridControl.Select怎么用?C# GridControl.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridControl
的用法示例。
在下文中一共展示了GridControl.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DevExpressTableView_ContextMenuPasteTextIntoGridBoundToDataTable
public void DevExpressTableView_ContextMenuPasteTextIntoGridBoundToDataTable()
{
var tableWithTwoStrings = new DataTable();
tableWithTwoStrings.Columns.Add("A", typeof(string));
tableWithTwoStrings.Columns.Add("B", typeof(string));
tableWithTwoStrings.Rows.Add("a", "b");
var gridControl = new GridControl();
var xtraGridContextMenu = new XtraGridContextMenu { SourceGrid = gridControl };
gridControl.ContextMenuStrip = xtraGridContextMenu;
gridControl.DataSource = tableWithTwoStrings;
Clipboard.SetText(string.Format("{0}\t{1}" + Environment.NewLine + "{0}\t{1}", "oe", "oe1"));
WindowsFormsTestHelper.Show(gridControl);
var v = (GridView)gridControl.FocusedView;
Assert.AreEqual(1, v.RowCount);
gridControl.Select();
v.SelectRow(0);
//copies data to the grid (two new rows are added.
xtraGridContextMenu.PasteClipboardContents();
Assert.AreEqual("oe", v.GetRowCellValue(0, v.Columns[0]));
Assert.AreEqual("oe1", v.GetRowCellValue(0, v.Columns[1]));
Assert.AreEqual("oe", v.GetRowCellValue(1, v.Columns[0]));
Assert.AreEqual("oe1", v.GetRowCellValue(1, v.Columns[1]));
WindowsFormsTestHelper.ShowModal(gridControl);
}