日期:2014-05-20  浏览次数:20693 次

请大家帮帮忙,帮我解决下!
怎么读取dataGrid的一个单元格的数据
dataGridTextBoxColumn1.TextBox.Text好像不对的    
在datagrid中有两行数据,我怎么读取我选中的单元格的值??

------解决方案--------------------
第一行,第一列数据:this.dataGridView1[0.0].Value


------解决方案--------------------
private void dataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if(e.CommandName== "show ")
{
Response.Redirect( "showText.aspx?ID= "+e.Item.Cells[0].Text+ "&Name= "+e.Item.Cells[1].Text);
}

e.Item.Cells[0].Text就是所选择的第一列的值