Так мне не нужна строка отсоединенная от DataSet'а.
Нужен ее индекс в DataSet'е.
BindingManagerBase bind = this.BindingContext[DataSet1];
CurrencyManager CurrencyManager1 = (CurrencyManager)bind;
DataSet1.DefaultView[CurrencyManager1.Position].Row
- вот примерно то что Вы посоватовали. Добраться же до самого DataSet'а из CurrencyManager1 не получается....
после инициализации:
BindingManagerBase bind = this.BindingContext[DataSet1, "TableName"];
BindingManagerBase bind = this.BindingContext[DataSet1.TableName];
В коде:
((DataSet1.DataTableRow)((DataRowView)bind.Current).Row).KeyID
(KeyID это ColumnName, определенное в таблице твоего DataSet1) mood = (health == good) ? excelent : bad;
WBR, My Blog
|