Please help me, how to delete dynamically created tab in UltraWebTab.for creating tab i am using this code
.UltraWebTab1.Tabs.Count + 1;
.WebTab);
tab.Key =
+ tabs.ToString();
.UltraWebTab1.Tabs.Add(tab);
tab.ContentPane.UserControlUrl =
;
// do not allow to jump size of UltraWebTab when UserControl is too big
tab.ContentPane.Scrollable = Infragistics.WebUI.UltraWebTab.
.Auto;
.UltraWebTab1.DataBind();
Please help me how to delete dynamically creatd tab...
Hi Sandip,
There are 2 methods Remove(tab) and RemoveAt(index). You may use any of them. Below is example (assume that page has 2 buttons AddTab and RemoveTab and they have corresponding handlers on click).
protected void AddTab_Click(object sender, EventArgs e) { int count = this.UltraWebTab1.Tabs.Count; Infragistics.WebUI.UltraWebTab.Tab tab = new Infragistics.WebUI.UltraWebTab.Tab("Tab" + count); tab.Key = "TabKey" + count; this.UltraWebTab1.Tabs.Add(tab); } protected void RemoveTab_Click(object sender, EventArgs e) { // find tab by key and remove it Infragistics.WebUI.UltraWebTab.Tab tab = this.UltraWebTab1.Tabs.FromKeyTab("TabKey1"); if(tab != null) this.UltraWebTab1.Tabs.Remove(tab); // remove tab at index int tabIndexToRemove = 1; int count = this.UltraWebTab1.Tabs.Count; if (count > tabIndexToRemove) this.UltraWebTab1.Tabs.RemoveAt(tabIndexToRemove); }