Bonjour,

ceci est une question simple, mais je n'arrive pàlus à retrouver comment faire pour les gridview, je le fais avec les datagrid pourtant

j'ai vu ceci sur msdn:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if(e.CommandName=="Select")
    {
 
      // Convert the row index stored in the CommandArgument
      // property to an Integer.
      int index = Convert.ToInt32(e.CommandArgument);    
 
      // Get the last name of the selected author from the appropriate
      // cell in the GridView control.
      GridViewRow selectedRow = CustomersGridView.Rows[index];
      TableCell contactName = selectedRow.Cells[1];
      string contact = contactName.Text;  
 
      // Display the selected author.
      Message.Text = "You selected " + contact + ".";
 
    }
alors je fais ceci:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
string monstring = GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].ToString();
mais cela ne fonctionne pas il me renvoie ceci:
System.Web.UI.WebControls.DataControlFieldCell
pouvez vous m'indiquer la bonne syntaxe??