tags:

views:

190

answers:

3

I'm populating a C# DataGrid with some values, and I'd like to retrieve a value from a cell when I click on that. How do I go about doing that with the .NET 1.1 Framework?

datagridview1 is not available in .net1.1

only for windows applications

A: 

Does the following work:

string strCell = (string)dataGridView1.CurrentCell.Value;
Belliez
A: 

This link shows you how to do this with .NET 1.1 using WinForms.

j0rd4n
+1  A: 

If you are talking about a web/ASP.Net 1.1 DataGrid:

  1. Use myDataGrid.Items to get a row
  2. Use row.Cells[x] to get a column in that row
  3. Use (TextBox)cell.FindControl("TextBox1") to get a control inside the cell

For more info, see Accessing a Control’s Value from DataGrid in ASP.NET

Eric Lathrop