I Have a UserControl called TenantList.ascx which contains a slightly modified GridView from DevExpress (Web.ASPxGridView). This control makes Callbacks without causing a postback which is exactly what I need. The specific event I need to react on is CustomButtonClicked. I have made my on OnCustomButtonClicked event on the usercontrol TenantList.ascx that fires when the the GridView CustomButtonClicked event fires.
I have an eventhandler on the page where I use the UC. When I debug using VS I can see that I get into the eventhandler as I am suppose to. My Eventhandler looks like this:
protected void uc_TenantList_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { Tenant tenant = (Tenant)uc_TenantList.GetGridView().GetRow(e.VisibleIndex); switch (e.ButtonID) { case 'btn_show': ShowRow(tenant); break; case 'btn_edit': EditRow(tenant); break; case 'btn_delete': DeleteRow(tenant.Id); break; default: break; } } private void EditRow(Tenant tenant) { uc_TenantDetails.SetTenantData(cBLL.GetTenant(tenant.Id)); UpdatePanel1.Update(); }
The EditRow function get’s called and the UserControl TenantDetails.ascx gets filled with data correctly. However the UpdatePanel1.Update(); is not updating the panel where my TenantDetails UserControl is in.
However if i call UpdatePanel1.Update(); from a normal control registered to the ScriptManager it updates just fine.
protected void Button1_Click(object sender, EventArgs e) { uc_TenantDetails.SetTenantData(cBLL.GetTenant(17)); UpdatePanel1.Update(); }
That works without a problem… I am 100% stuck and without any idea of what might be the problem here.
Any suggestion is welcome!!
Cheers The Real Napster – In real trouble 🙂
Okay solved this issue
What I needed to do was to enable postback on the gridview control inside my usercontrol. Then place the Gridview usercontrol in a updatepanel and still keep the details usercontrol in another updatepanel.
That way it all worked out. Not impressed by the solution though. Looks a bit ugly.