Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cell value
Message
De
29/03/2005 04:10:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/03/2005 23:01:41
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Titre:
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00999591
Message ID:
00999616
Vues:
49
>I have a simple form which contains a grid. The grid is populated by a data set. I would like to be able to click on a cell and then click a button that runs a method which needs the value in the cell.
>
>In VFP I could get the value by using the command thisform.grid1.column1.text1.value.
>
>What is the comperable command in .NET using C#? I can't seem to find the right syntax.
>
>thanks
>
>Alan Wyne

There are multiple ways and this is one of them:
  int iRow = myDataGrid.CurrentCell.RowNumber;
  int iCol = myDataGrid.CurrentCell.ColumnNumber;
  DataSet ds = (DataSet)myDataGrid.DataSource;
  MessageBox.Show( ds.Tables["tablename"].Rows[iRow][iCol].ToString() );
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform