本文整理汇总了C#中IGrid.GetInsertionRow方法的典型用法代码示例。如果您正苦于以下问题:C# IGrid.GetInsertionRow方法的具体用法?C# IGrid.GetInsertionRow怎么用?C# IGrid.GetInsertionRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGrid
的用法示例。
在下文中一共展示了IGrid.GetInsertionRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PasteClipBoardToInsertionRow
/// <summary>
///
/// </summary>
public static void PasteClipBoardToInsertionRow(IGrid grid)
{
string data = m_copyDataForPaste;
if (!string.IsNullOrEmpty(data))
{
InsertionRow row = grid.GetInsertionRow();
if (row != null)
{
row.BeginEdit();
string[] ss = data.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
if (ss.Length < 2)
return;
Dictionary<int, string> columnNames = new Dictionary<int,string>();
string[] sss = ss[0].Split(new char[] { '\t' }, StringSplitOptions.None);
{
for (int j = 0; j < sss.Length; ++j)
{
columnNames[j] = sss[j];
}
}
for (int i = 1; i < ss.Length; )
{
sss = ss[i].Split(new char[] { '\t' }, StringSplitOptions.None);
for (int j = 0; j < sss.Length; ++j)
{
try
{
if (grid.Columns[columnNames[j]] == null)
continue;
if (string.IsNullOrEmpty(sss[j]))
{
row.Cells[columnNames[j]].Value = null;
}
else
{
object r = ConvertHelper.ChangeType(sss[j], grid.Columns[columnNames[j]].DataType);
row.Cells[columnNames[j]].Value = r;
}
}
catch (Exception ex)
{
ExceptionProcess.ProcessWithNotify(ex);
}
}
break;
}
}
}
}
示例2: CancelEditCurrentDataRow
/// <summary>
///
/// </summary>
public static void CancelEditCurrentDataRow(IGrid grid)
{
// ��enter Edit Mode ���Ҳ����ڵ��б�����ִ���
try
{
Xceed.Grid.CellRow row = grid.CurrentRow as Xceed.Grid.CellRow;
if (row != null && row.IsBeingEdited)
{
row.CancelEdit();
}
InsertionRow insertionRow = grid.GetInsertionRow();
if (insertionRow != null) //��һ����Edit && insertionRow.IsBeingEdited)
{
insertionRow.CancelEdit();
// bug in xceed?
foreach (Xceed.Grid.Cell cell in insertionRow.Cells)
{
cell.ResetReadOnly();
}
}
}
catch (Exception ex)
{
ExceptionProcess.ProcessWithResume(ex);
}
}