首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

低级有关问题,dataview按钮列对应行的取值有关问题

2012-02-29 
低级问题,dataview按钮列对应行的取值问题。dataview中有一个按钮列,点击按钮如何获取按钮对应的行某一单元

低级问题,dataview按钮列对应行的取值问题。
dataview中有一个按钮列,点击按钮如何获取按钮对应的行某一单元格的值,谢谢!!!

[解决办法]
sorry 没看清是gridview

<%@ Page language= "C# " %>

<script runat= "server ">

void CustomersGridView_SelectedIndexChanged(Object sender, EventArgs e)
{

// Get the currently selected row using the SelectedRow property.
GridViewRow row = CustomersGridView.SelectedRow;

// Display the company name from the selected row.
// In this example, the third column (index 2) contains
// the company name.
Message.Text = "You selected " + row.Cells[2].Text + ". ";

}

热点排行