Hi Ryan,
You could in the Set Up Before of the form hook onto the Grids changed event to get in ahead of Jiwa an example of this is below for a different grid, and show a message / throw an exception if the input was invalid
- Code: Select all
jgRunLines.Change += jgRunLines_Change;
private void jgRunLines_Change(object sender, FarPoint.Win.Spread.ChangeEventArgs e)
{
//System.Diagnostics.Debugger.Break();
string Key = null;
string ColID = jgRunLines.ActiveSheet.Columns[e.Column].Tag.ToString();
if (ColID == "NoItems" && e.Column == NoItemsColumn)
{
Key = jgRunLines.get_GridText("RecID", e.Row).ToString();
JiwaDeliveries.JiwaDeliveryRunInstanceLine line = this._run.Lines[Key];
decimal newitems = decimal.Parse(jgRunLines.get_GridText("NoItems", e.Row).ToString());
if(newitems > 0)
{
line.NoItems = decimal.Parse(jgRunLines.get_GridText("NoItems", e.Row).ToString());
this.UltraToolbarsManager1.Tools["ID_RecordSave"].SharedProps.Enabled = true;
this.UltraToolbarsManager1.Tools["ID_RecordCancel"].SharedProps.Enabled = true;
line.ChangeFlag = true;
this._run.RecalcItemsAndOrders();
this.utOrders.Value = this._run.NoOrders.ToString();
this.utItems.Value = this._run.NoItems.ToString();
}
else
{
jgRunLines.set_GridText("NoItems",e.Row,line.NoItems.ToString());
System.Windows.Forms.MessageBox.Show("Number must be greater than zero.");
}
}
}
There is also EditModeOff which looks like
- Code: Select all
private void fpSpread1_EditModeOff(object sender, System.EventArgs e)
{
ListBox1.Items.Add("EditModeOff event fired!");
}
Also CustomFieldValue and CustomField also implement INotifyPropertyChanged so you could hook into this possibly as well.