Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field details
Message
De
06/07/2006 02:08:53
 
 
À
05/07/2006 13:07:30
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Divers
Thread ID:
01133895
Message ID:
01134045
Vues:
13
DataGridViewRow dr = myDataGridView.CurrentRow;
MessageBox.Show( (string)dr["town"]
Hi, Cetin...

Just a side-note, did you try that code? I still use the BindingContext position and the current view of the source data, but I gave it a try.

I got an error as well - unless I'm missing something, the DataGridViewRow object doesn't seem to have a direct indexer. I had to do the following:
DataGridViewRow dr = myDataGridView.CurrentRow;
MessageBox.Show(  Convert.ToString( dr.Cells["MyColDataGridViewTextBoxColumn"]));     

                           // is the "GridViewTextBoxColumn needed?   Don't know

// or

MessageBox.Show(  Convert.ToString( dr.Cells[ColNumber]));
At any rate, I still prefer the binding context (assuming it's bound data). Plus which, I don't think the DataGridViewRow will work if you want to reference a column in the source data that isn't displayed in the grid.

Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform