BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e) { bool ctl = ((Control.ModifierKeys & Keys.Control) != 0); if(ctl && e.KeyCode == Keys.Enter) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; string newValue = cc.Renderer.ControlText; GridRangeInfo range = this.gridDataBoundGrid1.Selections.Ranges.ActiveRange; if(range.Height > 1 || range.Width > 1) { this.gridDataBoundGrid1.Model.ChangeCells(range, newValue); e.Handled = true; } } }
private void gridDataBoundGrid1_ValidateFailed(object sender, GridValidateFailedEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
cc.ErrorMessage = "MyMessage";
}
try { this.gridDataBoundGrid1.Model.ChangeCells(range, newValue); } catch { cc.Lock(); MessageBox.Show("Cannot complete..."); cc.Unlock(); cc.RejectChanges(); this.gridDataBoundGrid1.Binder.CancelEdit(); } e.Handled = true;
>try >{ > this.gridDataBoundGrid1.Model.ChangeCells(range, newValue); >} >catch >{ > cc.Lock(); > MessageBox.Show("Cannot complete..."); > cc.Unlock(); > cc.RejectChanges(); > this.gridDataBoundGrid1.Binder.CancelEdit(); >} >e.Handled = true; >
for(int row = range.top; row <= range.Bottom; ++row)
{
for(int col = range.Left; col <= range.Right; ++col)
{
this.gridDataBoundGrid1[row, col].Text = newValue;
}
}