- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
private void LettersOnChanged(object sender, EventArgs eventArgs)
{
this._lettersBinding.Clear();
this._lettersBinding.AddRange(this._letters);
this.MailAgentGridControl.ResetBindings();
this.MailAgentGridControl.RefreshDataSource();
_bindingSourceLetters.ResetCurrentItem();
_bindingSourceLetters.ResetBindings(false);
int pos = _bindingSourceLetters.Position;
this.MailAgentGridControl.DataSource = null;
this.MailAgentGridControl.DataSource = _bindingSourceLetters;
if (_bindingSourceLetters.Current == null)
{
_guiCtrl.CurrentLetter = null;
return;
}
if (pos > _bindingSourceLetters.Count - 1)
pos = _bindingSourceLetters.Count - 1;
if (pos < 0)
return;
_bindingSourceLetters.Position = pos;
MailAgentGridControlTableView.UnselectRow(MailAgentGridControlTableView.GetRowHandle(0));
MailAgentGridControlTableView.SelectRow(pos);
}
Все ради того,чтоб при изменении датабинда в гриде менялась строка выделения.