2010-11-26 53 views
2

當行正在綁定時,我需要取一個特定值Ex FirstName,並用一些邏輯改變顯示FirstName字段的標籤。GridView檢索每一行中的數據

我正在使用此腳本沒有成功。

如何訪問該字段?由於

protected void uxListAuthorsDisplayer_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
     switch (e.Row.RowType) 
     { 
      // In case type of row is DataRow (a data row of GridView) 
      case DataControlRowType.DataRow: 
       e.Row.DataItem[1].Value.ToString(); 
       break; 
     } 
} 
+0

@Glbbok請指明問題correclty.From在這裏,我明白你想改變gridview中的標籤爲特定的字段。你在gridview.Pls中使用ItemTemplate提供一些關於gridview – kbvishnu 2010-11-26 11:20:24

回答

1

什麼

e.Row.Cells[x].Text 

其中x是列索引?

相關問題