July 6, 2012

Gridview RowDatabound Event


 <asp:BoundField DataField="IssCode" Visible = "False" HeaderText = "Issuecode">
</asp:BoundField>



protected void gvIPOReport_RowCommand(object sender, GridViewCommandEventArgs e)
{
  if (Session["UserId"] != null)
{
  if (e.CommandName == "DeleteRow")
{
  GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
string ApplyId = gvIPOReport.DataKeys[row.RowIndex].Value.ToString();
string IssueCode = gvIPOReport.Rows[row.RowIndex].Cells[13].Text.ToString();         
DataAccess oData = new DataAccess();
int iCount = oData.DeleteApplicationDetails(ApplyId,   Session["UserId"].ToString().Trim().ToUpper(), IssueCode);
if (iCount > 0)
{
  FillGrid();
 
}
  else
{


}
  }
  }
  else
{
  lblErrorMessage.Text = "Session Expired Please login again.";
}
 }

No comments:

Post a Comment