protected virtual void OnDisabledItemSelected(object sender, IndexEventArgs e) { if (DisabledItemSelected != null) { DisabledItemSelected(sender, e); } }
protected override void OnSelectedIndexChanged(EventArgs e) { int currentSelectedIndex = SelectedIndex; List<int> selectedDisabledIndices = new List<int>(); for (int i = 0; i < SelectedIndices.Count; i++) { if (disabledIndices.Contains(SelectedIndices[i])) { selectedDisabledIndices.Add(SelectedIndices[i]); SelectedIndices.Remove(SelectedIndices[i]); } } foreach (int index in selectedDisabledIndices) { IndexEventArgs args = new IndexEventArgs(index); OnDisabledItemSelected(this, args); } if (currentSelectedIndex == SelectedIndex) base.OnSelectedIndexChanged(e); }