9 个解决方案
#1
你是指gridview的哪个事件?
#2
可以在gridview中设置一个主键 为你要取的值
//获取行的索引
int index = ((GridViewRow)(((ImageButton)(e.CommandSource)).Parent.Parent)).RowIndex;
//获取更改行的编号
int Id = int.Parse(GridView——Name.DataKeys[index].Value.ToString());
//获取行的索引
int index = ((GridViewRow)(((ImageButton)(e.CommandSource)).Parent.Parent)).RowIndex;
//获取更改行的编号
int Id = int.Parse(GridView——Name.DataKeys[index].Value.ToString());
#3
行绑定应该可以吧
#4
可以,的,
dataitem里面试试
dataitem里面试试
#5
jquery很方便
#6
string _ids = string.Empty;
for (int i = 0; i < Gridview1.Rows.Count; i++)
{
// _ids = Gridview1.DataKeys[i].Value.ToString());
_ids = Gridview1.Rows[i].Cells[0].Text.ToStrin;
}
Textbox1.text = _ids.ToString();
#7
/// <summary>
/// 行绑定事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lb = e.Row.FindControl("lnkbtnDelete") as LinkButton;
lb.Attributes.Add("onclick", "return confirm('确定删除吗?')");
}
}
#8
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//hiddenfield保存数据
}
}
gridview SelectedIndexChanged
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//hiddenfield保存数据
}
}
gridview SelectedIndexChanged
#9
string _ids = string.Empty;
for (int i = 0; i < Gridview1.Rows.Count; i++)
{
// _ids = Gridview1.DataKeys[i].Value.ToString());
_ids = Gridview1.Rows[i].Cells[0].Text.ToString;
}
Textbox1.text = _ids.ToString();
#1
你是指gridview的哪个事件?
#2
可以在gridview中设置一个主键 为你要取的值
//获取行的索引
int index = ((GridViewRow)(((ImageButton)(e.CommandSource)).Parent.Parent)).RowIndex;
//获取更改行的编号
int Id = int.Parse(GridView——Name.DataKeys[index].Value.ToString());
//获取行的索引
int index = ((GridViewRow)(((ImageButton)(e.CommandSource)).Parent.Parent)).RowIndex;
//获取更改行的编号
int Id = int.Parse(GridView——Name.DataKeys[index].Value.ToString());
#3
行绑定应该可以吧
#4
可以,的,
dataitem里面试试
dataitem里面试试
#5
jquery很方便
#6
string _ids = string.Empty;
for (int i = 0; i < Gridview1.Rows.Count; i++)
{
// _ids = Gridview1.DataKeys[i].Value.ToString());
_ids = Gridview1.Rows[i].Cells[0].Text.ToStrin;
}
Textbox1.text = _ids.ToString();
#7
/// <summary>
/// 行绑定事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lb = e.Row.FindControl("lnkbtnDelete") as LinkButton;
lb.Attributes.Add("onclick", "return confirm('确定删除吗?')");
}
}
#8
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//hiddenfield保存数据
}
}
gridview SelectedIndexChanged
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//hiddenfield保存数据
}
}
gridview SelectedIndexChanged
#9
string _ids = string.Empty;
for (int i = 0; i < Gridview1.Rows.Count; i++)
{
// _ids = Gridview1.DataKeys[i].Value.ToString());
_ids = Gridview1.Rows[i].Cells[0].Text.ToString;
}
Textbox1.text = _ids.ToString();