2011-01-07 12 views

答えて

4

多分次の方法が役立ちます。

マークアップ:

<asp:GridView id="testGrid" OnRowDataBound="testGrid_RowDataBound" ... runat="server"> 
    ...... 
</asp:GridView> 

コードビハインド:

protected void testGrid_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    string val = string.Empty; 

    if (e.Row.RowType == DataControlRowType.DataRow) 
    { 
     foreach(TableCell cell in e.Row.Cells) 
      val = cell.Text; 
    } 
} 

- パベル

関連する問題