Gridview not updating after removing row from linkbutton within an updatePanel
<p>I have a linkbutton in a gridview that when clicked will update the DB and should remove it from being visible in the gridview. This is also in an updatepanel. 
When clicking the linkbutton the DB is updated, however the gridview is never refreshed.
Both gridview and linkbuttons are dynamically generated.</p>

<p>Linkbuttons are created as follows:
'b' contains the unique id of the data in the row.</p>

<pre><code>if (e.Row.RowType == DataControlRowType.DataRow)
{     
        LinkButton lbRemove = new LinkButton();
        lbRemove.ID = "removeLink" + b;              
        lbRemove.Command += new CommandEventHandler(lbRemove_Click);
        lbRemove.Attributes.Add("onclick","return confirm('Are you sure?');");
        .......
        e.Row.Cells[6].Controls.Add((Control)lbRemove);
</code></pre>

<p>lbRemove_Click contains the method to update DB and call the griview to bind amd update the panel:</p>

<pre><code>protected void lbRemove_Click(object sender, CommandEventArgs e)
{                         
      removeFromUser(Convert.ToInt32(e.CommandArgument.ToString()));             
      loadGridviews(Convert.ToInt32(ViewState["currUserID"]));
      upnlUserDevices.Update();
</code></pre>

<p>i have tried creating a linkbutton outside of the gridview using the exact same properties as the one in the gridview. When clicked it calls the same method and it refreshes the gridviews, just not when being clicked from within the gridview itself.</p>

<p>Bit stuck on this one if you can help??
Thanks!</p>
