December 17, 2011

Gridview button Row Command

<asp:BoundField DataField=
</asp:BoundField>


protected
{
void gvIPOReport_RowCommand(object sender, GridViewCommandEventArgs e)if
{
(Session["UserId"] != null)if
{
GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
(e.CommandName == "DeleteRow")string ApplyId = gvIPOReport.DataKeys[row.RowIndex].Value.ToString();string IssueCode = gvIPOReport.Rows[row.RowIndex].Cells[13].Text.ToString(); // Column 13 is HeaderText = "Issuecode">DataAccess oData = new DataAccess();int iCount = oData.DeleteApplicationDetails(ApplyId, Session["UserId"].ToString().Trim().ToUpper(), IssueCode);if
{
rowErrorMessgage.Visible =
lblErrorMessage.Text =
}
(iCount > 0)false;"Record Deleted Successfully.";else{
}
}
}
else{
lblErrorMessage.Text =
"Session Expired Please login again."
}
;
"IssCode" Visible = "False" HeaderText = "Issuecode">

No comments:

Post a Comment