views:

80

answers:

3

Hello,

I'm trying to use ASPxPageControl ase a template for my wizard. I put buttons on each page and connected it to javascript which simply changes active page, for example:

Pc1Client.SetActiveTab(Pc1Client.GetTab(1));

It works correct when tabs are visible but when I set

ASPxPageControl1.ShowTabs = "false"

then when trying to change tab by clicking my button an error is raised (sth that formant with that name already exists or sth like that, i ve got error message in polish )

Am I doing anything wrong ?

Thanks for help

+1  A: 

That's because when you do ASPxPageControl1.ShowTabs = "false" tabs do not render on page and they are not available through JavaScript

ajay_whiz
Is there any way in which I can hide them and still make them available by javascript? I dont want user to be able to change those tabs manually
gruber
@snorlaks you can hide them initialy by setting its style in CSS to "display:none"
ajay_whiz
Which style ? Style of what ?
gruber
@snorlaks show me your aspx. Also you can have a look at this demo http://demos.devexpress.com/ASPxperienceDemos/TabControl/ServerSide.aspx
ajay_whiz
+1  A: 

Hi,

To resolve this problem and make your code work, set the ASPxPageControl's EnableClientSideAPI property to true. In this case, everything should work properly.

DevExpress Team
After setting this property and writing in Page_Load event :ASPxPageControl1.ShowTabs = false;there is still the same problem while trying to change current tab from javascript.It works when this property (ASPxPageControl1.ShowTabs) isnt set to false,thanks
gruber
+1  A: 

Hi,

Here is the code I used (The ASPxPageControl's version is 10.1.6):

<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="2" ClientInstanceName="pc" EnableClientSideAPI="True">
    <TabPages>
        <dx:TabPage Text="Tab 0">
            <ContentCollection>
                <dx:ContentControl runat="server">
                    0<br />
                </dx:ContentControl>
            </ContentCollection>
        </dx:TabPage>
        <dx:TabPage Text="Tab 1">
            <ContentCollection>
                <dx:ContentControl runat="server">
                    1</dx:ContentControl>
            </ContentCollection>
        </dx:TabPage>
        <dx:TabPage Text="Tab 2">
            <ContentCollection>
                <dx:ContentControl runat="server">
                    2</dx:ContentControl>
            </ContentCollection>
        </dx:TabPage>
    </TabPages>
</dx:ASPxPageControl>
<input type="button" value="click" onclick="pc.SetActiveTab(pc.GetTab(0));" />


protected void Page_Load(object sender, EventArgs e) {
    ASPxPageControl1.ShowTabs = false;
}

It works correctly here.

DevExpress Team
In this case its true, works correctly but when I have grids in this tab pages there is an error. maybe im doing something wrong I need to check it, anyway thanks
gruber
Please post your aspx markup here. I will review it and let you know how to resolve the problem.
DevExpress Team