0
我想獲取點擊列的名稱和點擊行的值。Gridview Row - 值和列名
我發現很好的例子,但我不能得到我想要的這些數據。
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onClick"] = "location.href='view.aspx?id_lekarza=" + DataBinder.Eval(e.Row.DataItem, "Id_lekarza") + " &klikniete=" + "sss" + " '";
}
}
e.Row.RowIndex所有時間0?
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "javascript:alert('" + e.Row.RowIndex + "');");
e.Row.Style.Add("cursor", "pointer");
}
}
你可以舉個例子來說明事件GridView1_RowCreated()嗎? – RPD
上面的代碼就是一個例子!你有沒有失望?你非常想知道什麼? – Karamafrooz
列的名稱被選中行 – RPD