private void List_BeforeChange(object sender, RejectableEventArgs <object> e) { if (e.Value.ToString() == "Görkem") { e.RejectOperation(); } }
private void HandleBeforeChanged(object sender, RejectableEventArgs <string> e) { bool test = e.IsOperationRejected; //e.RejectOperation(); Count = e.Count; }
private void HandleBeforeChanged(object sender, RejectableEventArgs <string> e) { if (e.Value == "lök") { e.RejectOperation(); Rejected = true; //throw new OperationRejectedException(); } // För test }
void intList_BeforeChange(object sender, RejectableEventArgs <int> e) { if (Operation.Add == e.Operation && e.Value > 1000) { e.RejectOperation(); MessageBox.Show("Only values of 1000 and below accepted."); } else if (Operation.Remove == e.Operation && e.Count <= 2) { e.RejectOperation(); MessageBox.Show("Cannot reduce list to less than 2 elements."); } }