1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| private void gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex >= 0)
{
for (int cellIndex = 1; cellIndex < e.Row.Cells.Count; cellIndex++)
{
e.Row.Cells[cellIndex].Attributes.Add("onmouseover", string.Format("this.style.cursor = 'hand'"));
e.Row.Cells[cellIndex].ToolTip = "test";
e.Row.Cells[cellIndex].Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(this.gridview1, "Select$" + e.Row.DataItemIndex, true);
}
}
}
private void gridview1_RowCommand(object sender, GridViewCommandEventArgs e)
{
String txt = this.gridview1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[???].Text;
} |
Partager