Response.Write(e.Item.Cells[1].Control[0].Text ); 

解决方案 »

  1.   

    你的DataGrid还没绑定数据呢?你得在绑定之后才能获取它的值。把上面的代码反过来,这样写:this.DataGrid1.DataBind();
    Response.Write(e.Item.Cells[1].Text ); 
      

  2.   

    前面已经绑定绑定。               
    sqlcon.Open();
    //string str1="select  * from propertylistview where adrname like '"+ this.TextBox1.Text +"'";
    string str1="select top 10 adrname,pptid,pptfloor,pptflat from propertylistview";
      System.Data.SqlClient.SqlDataAdapter sqadp=new System.Data.SqlClient.SqlDataAdapter(str1,sqlcon);
       
           System.Data.DataSet dst=new DataSet();
    sqadp.Fill(dst,"ddd");
     
    DataView objdataview=new DataView(dst.Tables ["ddd"]);
                this.DataGrid1.DataSource=objdataview;
    this.DataGrid1.DataBind(); 但我发现e.Item.Cells[1].Text 的值一直为""
      

  3.   

    TO: LinYeCunFu(耕夫) 提示:
    c:\inetpub\wwwroot\centanet\proresearch.aspx.cs(109,19): error CS0117: “System.Web.UI.Control”并不包含对“Text”的定义
      

  4.   

    this.DataGrid1.DataBind();
    Response.Write(DataGrid1.Item[1].Cells[1].Text ); 
    你的e.items并不代表那一行,所以找不到,请用上面,肯定能得到
      

  5.   

    this.DataGrid1.DataBind();
    Response.Write(DataGrid1.SelectedItem.Cells[1].Text );
      

  6.   

    我已经解决了。
    方法为:
      只有Boundcolumn列和自动列,才可以通过TABLECELL。TEXT属性读取显示的文本。谢谢楼上各位!!!!!!