Répondre

0

Le code suivant fait ce que vous voulez:

// Get the context. 
BindingContext context = myGrid.BindingContext; 

// Get the currency manager. 
BindingManagerBase manager = context [myDataset, "MyTable"]; 

// Get the current row view. 
DataRowView rowView = (DataRowView) manager.Current; 

// Assume you have a bit field and want to get its value 
bool flag = (bool) rowView ["MyBitField"]; 

Hope this helps.

0

Accédez aux cellules CurrentRow (DataGridViewRow) ou aux éléments DataBoundItem, en fonction de vos besoins. Vous devrez convertir l'objet DataBoundItem en une ligne de données fortement typée.

Dim oRow As FooDataRow = DirectCast(CurrentRow.DataBoundItem, FooDataRow) 
Questions connexes