I have my webtabs set to.
<
PostBackOptions EnableAjax="True" EnableLoadOnDemand="True" />
and the SelectedIndexChanged event fires the first time i click each tab, but it never fires after the first click, so if I go back to the first tab or a tab I have click it doesn't fire. How can I make it fire ever time the tab is clicked?
I had a similar problem, the SelectedIndexChange event would trigger fine when moving from tab 1 to tab 2 or tab 3, but when I clicked back to tab 1, no event is triggered. Here is the PostBackOptions that I used:
<ig:WebTab ID="WebTab1" ... >
<Tabs> here I had 3 simple template tabs configured </Tabs>
<PostBackOptions EnableReloadingUnselectedTab="true" EnableAjax="true"
EnableLoadOnDemand="false" />
</ig:WebTab>
And here is the code behind with the problem:
protected void Page_Load(object sender, EventArgs e) {
WebTab1.SelectedIndexChanged += new TabSelectedIndexChangedEventHandler(TabChanged);
}
protected void TabChanged(object sender, TabSelectedIndexChangedEventArgs args) {
// Logic here
Here is how I solved it - I created my own event handler using the same PostBackOptions:
int WebTab1SelectedIndexOld = (int) (ViewState["WebTab1.SelectedIndex.Old"] ?? 0);
if (WebTab1SelectedIndexOld != WebTab1.SelectedIndex) {
TabChanged(WebTab1SelectedIndexOld, WebTab1.SelectedIndex);
ViewState["WebTab1.SelectedIndex.Old"] = WebTab1.SelectedIndex;
protected void TabChanged(int oldIndex, int newIndex) {
// Logic here....
I guess this is a bug in Infragistics (unless I'm not using the proper PostBackOptions), hopefully it will be fixed with the next release.
By the way, I have found the PostBackOptions way too confusing to use it direcly from Visual Studio - I had to read the whole API documentation to understand their combination - some options won't work by them themselves. I recommend the following reading: https://help.infragistics.com/Help/Doc/ASPNET/2010.2/CLR4.0/html/Infragistics4.Web.v10.2~Infragistics.Web.UI.LayoutControls.TabPostBackOptions.html
Please don't forget to mark answered if this have helped you.
Thanks,
Wagner Danda da Silva
Actually, I have found out a simpler workaround... Just add a UpdatePanel around the WebTab control... Once you do that then the event will be fired for the first tab click.
Cheers,
Already have the webtab control in an update panel. Trying to get it to fire on every tab change, not just the first click.
Can you show us a snippet of your code so we can help you better?
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <ig:WebTab ID="WebTab1" runat="server" Height="184px" Width="700px" StyleSetName="Default" EnableOverlappingTabs="true"> <Tabs> <ig:ContentTabItem runat="server" Text="tab 1"> </ig:ContentTabItem> <ig:ContentTabItem runat="server" Text="tab 2"> </ig:ContentTabItem> <ig:ContentTabItem runat="server" Text="tab 3"> </ig:ContentTabItem> </Tabs> <PostBackOptions EnableAjax="true" EnableLoadOnDemand="true" /> </ig:WebTab> </ContentTemplate> </asp:UpdatePanel>
Protected Sub WebTab1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.LayoutControls.TabSelectedIndexChangedEventArgs) Handles WebTab1.SelectedIndexChanged Label1.Text = Now.ToLongTimeString End Sub
The SelectedIndexChanged event only first for the first click on each tab, have tried a number of combinations with PostBackOptions with no luck.
You don't have the right PostBackOptions.... Try this instead:
<PostBackOptions
EnableReloadingUnselectedTab="true"
EnableAjax="true" EnableLoadOnDemand="false" />