public void StateChanged(BaseLogic sender, StateChangedEventArgs args) { if (args.State == eState.RETRIEVED) { this._DataSourceList = sender.Containers; this.RebindData(); } }
public void StateChanged(BaseLogic sender, StateChangedEventArgs args) { if (args.State == eState.DELETING) { this.JustDeleted = true; } if (args.State == eState.ADDED) { JustAdded = true; } if (args.State == eState.RETRIEVED) { int NextID = -1; if (this.SelectedItem != null) NextID = ((BaseContainer)this.SelectedItem).ID; if (this.JustDeleted) NextID = this.GetPreviousIndex(NextID); this.EnableSelectedIndexChanged = false; this._DataSourceList = sender.Containers; this.RebindData(); this.EnableSelectedIndexChanged = true; if (this.JustAdded) { this.SelectedIndex = this.GetMaxIndex(); this.JustAdded = false; return; } if (this.JustDeleted) { this.SelectedIndex = NextID; this.JustDeleted = false; return; } if (this.Items != null && this.Items.Count > 0) { if (NextID < 0) { this.SelectedIndex = 0; } else { int index = this.GetIndex(NextID); if (index < 0) this.SelectedIndex = 0; else this.SelectedIndex = index; } } } }
public void StateChanged(BaseLogic sender, StateChangedEventArgs args) { if (args.State == eState.RETRIEVED) { this.DataSource = sender.Container; } }
public override void StateChanged(BaseLogic sender, StateChangedEventArgs args) { }