读书人

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

发布时间: 2012-02-29 16:44:10 作者: rapoo

低级问题,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 + ". ";

}

读书人网 >C#

热点推荐