本文整理匯總了C#中System.Windows.Forms.DataGridViewCell.SetValueInternal方法的典型用法代碼示例。如果您正苦於以下問題:C# DataGridViewCell.SetValueInternal方法的具體用法?C# DataGridViewCell.SetValueInternal怎麽用?C# DataGridViewCell.SetValueInternal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.DataGridViewCell
的用法示例。
在下文中一共展示了DataGridViewCell.SetValueInternal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PushFormattedValue
private bool PushFormattedValue(ref DataGridViewCell dataGridViewCurrentCell, object formattedValue, out Exception exception)
{
Debug.Assert(this.IsCurrentCellInEditMode);
exception = null;
DataGridViewCellStyle cellStyle = this.InheritedEditingCellStyle;
DataGridViewCellParsingEventArgs dgvcpe = OnCellParsing(this.ptCurrentCell.Y,
this.ptCurrentCell.X,
formattedValue,
dataGridViewCurrentCell.ValueType,
cellStyle);
if (dgvcpe.ParsingApplied &&
dgvcpe.Value != null &&
dataGridViewCurrentCell.ValueType != null &&
dataGridViewCurrentCell.ValueType.IsAssignableFrom(dgvcpe.Value.GetType()))
{
if (dataGridViewCurrentCell.RowIndex == -1)
{
dataGridViewCurrentCell = this.Rows[this.ptCurrentCell.Y].Cells[this.ptCurrentCell.X]; // unsharing the row before pushing the new value
}
return dataGridViewCurrentCell.SetValueInternal(this.ptCurrentCell.Y, dgvcpe.Value);
}
object val;
try
{
val = dataGridViewCurrentCell.ParseFormattedValue(formattedValue, dgvcpe.InheritedCellStyle, null, null);
}
catch (Exception e)
{
if (ClientUtils.IsCriticalException(e))
{
throw;
}
exception = e;
return false;
}
if (dataGridViewCurrentCell.RowIndex == -1)
{
dataGridViewCurrentCell = this.Rows[this.ptCurrentCell.Y].Cells[this.ptCurrentCell.X]; // unsharing the row before pushing the new value
}
return dataGridViewCurrentCell.SetValueInternal(this.ptCurrentCell.Y, val);
}