Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cell value
Message
From
29/03/2005 04:10:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/03/2005 23:01:41
General information
Forum:
ASP.NET
Category:
WebForms
Title:
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00999591
Message ID:
00999616
Views:
48
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform