读书人

请大家帮帮忙帮小弟我解决下

发布时间: 2011-12-20 22:26:40 作者: rapoo

请大家帮帮忙,帮我解决下!
怎么读取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就是所选择的第一列的值

读书人网 >C#

热点推荐