I have a tab strip on the aspx. Code behind on that page allows me to open items from a grid that's on one of those tabs. As the user opens items, the first time an "Open Tests" tab gets dynamically added to the tab strip and a child tab gets added to that new tab for the item they opened. Additional opened tests get their own child tabs. I'm allowing up to 5 to keep resources under control. Each of these tabs gets its own page view in the multipage and the content is set to an ascx so that each new child tab has the same controls, just with the data for the record they opened.
On that ascx is a "Close" button. Click event on this button is this:
Thing is, you have to click the "Close" button twice to remove the tab. I put a breakpoint on the first line so that I could debug this code and what happens is, the user clicks the close button on an open child tab and it jumps to the code and I can F11 all the way through. Everything goes fine, but when it returns to the form, the tab is still there. Click the button again and it removes without going back to the breakpoint again.
If you do anything else in between, like click "Close" then change to a different tab and come back, it still wants you to click it twice.
Something's going on where the tabstrip itself isn't refreshing until the second click of the button; some sort of "timing of the postbacks" issue. Any ideas?
On that ascx is a "Close" button. Click event on this button is this:
protected
void
ButtonClose_Click(
object
sender, EventArgs e)
{
RadTabStrip rts = (RadTabStrip)
this
.Parent.FindControl(
"rtsDQEApplication"
);
RadTab currentTab = rts.InnermostSelectedTab;
if
(currentTab !=
null
)
{
IRadTabContainer owner = currentTab.Owner;
owner.Tabs.Remove(currentTab);
RadMultiPage rmp = (RadMultiPage)
this
.Parent.FindControl(
"rmpDQEApplication"
);
rmp.PageViews.RemoveAt(rmp.SelectedIndex);
}
}
Thing is, you have to click the "Close" button twice to remove the tab. I put a breakpoint on the first line so that I could debug this code and what happens is, the user clicks the close button on an open child tab and it jumps to the code and I can F11 all the way through. Everything goes fine, but when it returns to the form, the tab is still there. Click the button again and it removes without going back to the breakpoint again.
If you do anything else in between, like click "Close" then change to a different tab and come back, it still wants you to click it twice.
Something's going on where the tabstrip itself isn't refreshing until the second click of the button; some sort of "timing of the postbacks" issue. Any ideas?