Strong Coders Community

Where the extreme coders hang out.
Welcome to Strong Coders Community Sign in | Join | Help Messenger
in Search
Strong Coders Community » ASP.NET / .NET Framework » AspNet2 » Re: Get data from an DataGrid

Get data from an DataGrid

Last post 02-01-2007, 1:18 PM by JamesCurran . 1 replies.
Sort Posts: Previous Next
  •  02-01-2007, 12:51 AM 1695
    • Gerten is not online. Last active: 02-01-2007, 1:24 AM Gerten
    • Top 50 Contributor
      Male
    • Joined on 09-25-2006
    • Posts 1
    • Points 20

    Get data from an DataGrid

    Hi, I have an DataGrid were i sorted out some bowlingfriends, I want to get out the emailadresses from that DataGrid Column(3).

    but how too specified that i want just column no3  I tryed this:

    foreach (GridViewRow row in GridView1.Rows[3]) ;
           
    sTo = GridView1.RowDataBound.ToString();
    So i can get out my friends e-mail from the sorted DataGrid and send them an mail?

     

    Gert 

    • Post Points: 20
    • Alert the moderators
  •  02-01-2007, 1:18 PM 1698 in reply to 1695
    • JamesCurran is not online. Last active: Feb 11, 2007, 11:18 AM JamesCurran
    • Top 10 Contributor
      Male
    • Joined on 11-01-2006
    • Bloomfield, NJ, USA
    • Posts 82
    • Points 1,015
    • StrongCoders

    Re: Get data from an DataGrid

    foreach (GridViewRow row in GridView1.Rows)
    {
          string email = row.Cells[2].Text;    // note, columns count from 0, so the 3rd col is [2]

    Truth,
    James
    • Post Points: 5
    • Alert the moderators

Powered by Community Server (Commercial Edition), by Telligent Systems