Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Button click event is not firing on the second click for the user control

$
0
0

Hi all I have created a user control where I will have some 3 buttons on each and every button click I will assign a grid dynamically based on the button click with few values. Every thing works fine but when I delete a row from gridview and performing button click eventn again it is not firing the button click event.  

I am loading this user control in a popup of a web page and performing the operations on each click inside user control

My code in User control

DataTable dt= new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
  if (ViewState["CurrentTable"] == null)
  {
     dt.Columns.Add("Id", typeof(string));
     dt.Columns.Add("xx", typeof(string));
     dt.Columns.Add("xx", typeof(string));
     dt.Columns.Add("xx", typeof(string));
     dt.Columns.Add("xx", typeof(string));
  }
   }

protected void btn1_Click(object sender, EventArgs e)
{
  if (ViewState["CurrentTable"] == null)
  {
  }
  else
  {
      addrow("Some", txt1.Text);
  }
}

protected void grd_Deleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
{
       int iIndex;
        iIndex = grd.FocusedRowIndex;
        dt.Rows[iIndex].Delete();
        ViewState["CurrentTable"] =dt;
        grd.DataSource = dt;
        grd.DataBind();
}

What to do to perform the button click operation to fire again after deleting a row


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>