电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

gridview获取主键的值


发布日期:2021/4/24
 

在 GridView_RowCommand中获取主键的值

protected void GridView_RowCommand(object sender GridViewCommandEventArgs e)

{

int OrderId = ConvertToInt(GridViewDataKeys[ConvertToInt(eCommandArgument)]Value); }

在 GridView_PageIndexChanging中获取主键的值

protected void GridView_PageIndexChanging(object sender GridViewPageEventArgs e)

{

int index=GridViewDataKeys[eNewPageIndex]Value;

}

在 GridView_RowDeleting中获取主键的值

protected void GridView_RowDeleting(object sender GridViewDeleteEventArgs e)

{

int index=GridViewDataKeys[eRowIndex]Value;

}

在 GridView_RowEditing中获取主键的值

protected void GridView_RowEditing(object sender GridViewEditEventArgs e)

{

int index = GridViewDataKeys[eNewEditIndex]Value;

}

在 GridView_RowUpdating中获取主键的值

protected void GridView_RowUpdating(object sender GridViewUpdateEventArgs e)

{

int index = GridViewDataKeys[eRowIndex]Value;

}

在 GridView_RowDataBound中获取主键的值

protected void GridView_RowDataBound(object sender GridViewRowEventArgs e)

{

int index = GridViewDataKeys[eRowRowIndex]Value;

}

上一篇:SPGridView字段(单元格)换行

下一篇:XAML(1)--物件生成