?
Solved

How to make the form tab strip to work?

Posted on 2009-04-29
21
Medium Priority
?
864 Views
Last Modified: 2012-05-06
Hello,
Can someone help me with this?

I have vertical tab strip, multipage, using page views and I need them to display the page view when I click on them.

What I have right now is, they enable themselves as long as the submit button is clicked but if I want to go back to a previews radstrip, the tab is clickable but it does not display the page view, or the form. What attributes shouls I use.
see the cs bellow:
protected void Page_Load(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = false;
 
        RadTabStrip1.Tabs[2].Enabled = false;
 
        RadTabStrip1.Tabs[3].Enabled = false;
 
        RadTabStrip1.Tabs[4].Enabled = false;
 
        PageView1.Focus();
 
          
 
    }
 
    protected void Button1_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 1;
 
        RadTabStrip1.SelectedIndex = 1;
 
        PageView2.Focus();
 
    }
 
    protected void Button3_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadTabStrip1.Tabs[2].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 2;
 
        RadTabStrip1.SelectedIndex = 2;
 
        PageView3.Focus();
 
    }
 
 
 
    protected void Button5_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadTabStrip1.Tabs[2].Enabled = true;
 
        RadTabStrip1.Tabs[3].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 3;
 
        RadTabStrip1.SelectedIndex = 3;
 
        PageView4.Focus();
 
    }
 
    protected void Button7_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadTabStrip1.Tabs[2].Enabled = true;
 
        RadTabStrip1.Tabs[3].Enabled = true;
 
        RadTabStrip1.Tabs[4].Enabled = true;
 
        RadTabStrip1.Tabs[4].PageView.Enabled = PageView4;
 
        PageView4.Focus();
 
   
 
    }

Open in new window

0
Comment
Question by:Romacali
  • 11
  • 10
21 Comments
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24264454
in  PageLoad

add a check for postback

   if ( !PostBack)
  {
       RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = false;
 
        RadTabStrip1.Tabs[2].Enabled = false;
 
        RadTabStrip1.Tabs[3].Enabled = false;
 
        RadTabStrip1.Tabs[4].Enabled = false;
 
        PageView1.Focus();
 
  }
}

Otherwise you keep getting the same look
0
 

Author Comment

by:Romacali
ID: 24265363
hello there,

What I need is to enabled the page view that comes with clicking the tab strip, not the tab strip itself.
any idea?

thanks
0
 

Author Comment

by:Romacali
ID: 24280882
Right Now, I have the strip tabs and I'm able to see the forms only if I click on the button next... once I clicked on the other tabs the form doesn't change.. it keeps on the last one..
please I need some help..
thanks,
Caliu
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Expert Comment

by:williamcampbell
ID: 24281706
Can you try this code?
protected void Page_Load(object sender, EventArgs e)
     {
        if (!Page.IsPostBack){ 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = false;
 
        RadTabStrip1.Tabs[2].Enabled = false;
 
        RadTabStrip1.Tabs[3].Enabled = false;
 
        RadTabStrip1.Tabs[4].Enabled = false;
        
        PageView1.Focus();
        }
    }

Open in new window

0
 

Author Comment

by:Romacali
ID: 24281775
I can unable and disable buttons but I also want the form to come with each tab. Right now it is not :(

0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24282277
Did put in the change I posted above?
0
 

Author Comment

by:Romacali
ID: 24282857
yes I added but still nothing
0
 
LVL 12

Accepted Solution

by:
williamcampbell earned 1500 total points
ID: 24282905
Try keeping a variable for the current focus page
object lastView;
 
protected void Page_Load(object sender, EventArgs e)
     {
        if (!Page.IsPostBack)
        { 
             lastView = PageView1;
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = false;
 
        RadTabStrip1.Tabs[2].Enabled = false;
 
        RadTabStrip1.Tabs[3].Enabled = false;
 
        RadTabStrip1.Tabs[4].Enabled = false;
        }
        lastView.Focus();
        
    }
 
    protected void Button1_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 1;
 
        RadTabStrip1.SelectedIndex = 1;
 
        lastView = PageView2;
 
    }

Open in new window

0
 

Author Comment

by:Romacali
ID: 24283353
Now I got this error:
Compiler Error Message: CS0103: The name 'lastView' does not exist in the current context

 
0
 

Author Comment

by:Romacali
ID: 24283365
and this:
Or I get this error too

Compiler Error Message: CS0117: 'object' does not contain a definition for 'Focus'
0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24283456

 You need to add lastView to your class it should be the same type as PageView
 I'm not sure what type PageView is.
0
 

Author Comment

by:Romacali
ID: 24283567
here is what I have on the cs page

not sure how to add the lastView object
using System;
 
using System.Data;
 
using System.Configuration;
 
using System.Collections;
 
using System.Web;
 
using System.Web.Security;
 
using System.Web.UI;
 
using System.Web.UI.WebControls;
 
using System.Web.UI.WebControls.WebParts;
 
using System.Web.UI.HtmlControls;
 
 
 
public partial class PPTRadStrip : System.Web.UI.Page
 
{
 
   // object lastView;
 
 
 
    protected void Page_Load(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = false;
 
        RadTabStrip1.Tabs[2].Enabled = false;
 
        RadTabStrip1.Tabs[3].Enabled = false;
 
        RadTabStrip1.Tabs[4].Enabled = false;
 
        PageView1.Focus();
 
 
 
        }
 
    
 
    
 
    protected void Button1_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 1;
 
        RadTabStrip1.SelectedIndex = 1;
 
        PageView2.Focus();
 
    }
 
    protected void Button3_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadTabStrip1.Tabs[2].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 2;
 
        RadTabStrip1.SelectedIndex = 2;
 
        PageView3.Focus();
 
    }
 
 
 
    protected void Button5_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadTabStrip1.Tabs[2].Enabled = true;
 
        RadTabStrip1.Tabs[3].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 3;
 
        RadTabStrip1.SelectedIndex = 3;
 
        PageView4.Focus();
 
    }
 
    protected void Button7_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = true;
 
        RadTabStrip1.Tabs[2].Enabled = true;
 
        RadTabStrip1.Tabs[3].Enabled = true;
 
        RadTabStrip1.Tabs[4].Enabled = true;
 
        RadMultiPage1.SelectedIndex = 4;
 
        RadTabStrip1.SelectedIndex = 4;
 
        PageView5.Focus();
 
 
 
    }
 
    protected void Button9_Click(object sender, EventArgs e)
 
    {
 
        RadTabStrip1.Tabs[0].Enabled = true;
 
        RadTabStrip1.Tabs[1].Enabled = false;
 
        RadTabStrip1.Tabs[2].Enabled = false;
 
        RadTabStrip1.Tabs[3].Enabled = false;
 
        RadTabStrip1.Tabs[4].Enabled = false;
 
       // RadTabStrip1.Tabs[5].Enabled = false;
 
        RadMultiPage1.SelectedIndex = 0;
 
        RadTabStrip1.SelectedIndex = 0;
 
        PageView1.Focus();
 
       // Console.Write("You have succesfully entered the participant information");
 
        //lastView = PageView2;
 
 
 
 
 
 
 
    }

Open in new window

0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24283876
Should be like this ...
public partial class PPTRadStrip : System.Web.UI.Page
{
 
    public PageView lastView; // It should be type PageView
 
    protected void Page_Load(object sender, EventArgs e)
    {
 
        if ( !IsPostBack () )
        {
            RadTabStrip1.Tabs[0].Enabled = true;
            RadTabStrip1.Tabs[1].Enabled = false;
            RadTabStrip1.Tabs[2].Enabled = false;
            RadTabStrip1.Tabs[3].Enabled = false;
            RadTabStrip1.Tabs[4].Enabled = false;
 
            lastView = PageView1;
        }
 
        lastView.Focus ();
     }
 
    protected void Button1_Click(object sender, EventArgs e)
    {
        RadTabStrip1.Tabs[0].Enabled = true;
        RadTabStrip1.Tabs[1].Enabled = true;
        RadMultiPage1.SelectedIndex = 1;
        RadTabStrip1.SelectedIndex = 1;
 
        lastView = PageView2;
    }
 
    protected void Button3_Click(object sender, EventArgs e)
    {
        RadTabStrip1.Tabs[0].Enabled = true;
        RadTabStrip1.Tabs[1].Enabled = true;
        RadTabStrip1.Tabs[2].Enabled = true;
        RadMultiPage1.SelectedIndex = 2;
        RadTabStrip1.SelectedIndex = 2;
 
        lastView = PageView3;
    }
 
    protected void Button5_Click(object sender, EventArgs e)
    {
        RadTabStrip1.Tabs[0].Enabled = true;
        RadTabStrip1.Tabs[1].Enabled = true;
        RadTabStrip1.Tabs[2].Enabled = true;
        RadTabStrip1.Tabs[3].Enabled = true;
        RadMultiPage1.SelectedIndex = 3;
        RadTabStrip1.SelectedIndex = 3;
 
        lastView = PageView4;
    }
 
    protected void Button7_Click(object sender, EventArgs e)
    {
        RadTabStrip1.Tabs[0].Enabled = true;
        RadTabStrip1.Tabs[1].Enabled = true;
        RadTabStrip1.Tabs[2].Enabled = true;
        RadTabStrip1.Tabs[3].Enabled = true;
        RadTabStrip1.Tabs[4].Enabled = true;
        RadMultiPage1.SelectedIndex = 4;
        RadTabStrip1.SelectedIndex = 4;
 
        lastView = PageView5;
    }
 
    protected void Button9_Click(object sender, EventArgs e)
    {
        RadTabStrip1.Tabs[0].Enabled = true;
        RadTabStrip1.Tabs[1].Enabled = false;
        RadTabStrip1.Tabs[2].Enabled = false;
        RadTabStrip1.Tabs[3].Enabled = false;
        RadTabStrip1.Tabs[4].Enabled = false;
 
       // RadTabStrip1.Tabs[5].Enabled = false;
 
        RadMultiPage1.SelectedIndex = 0;
        RadTabStrip1.SelectedIndex = 0;
 
        lastView = PageView1;
 
       // Console.Write("You have succesfully entered the participant information");
 
        //lastView = PageView2;
    }
}

Open in new window

0
 

Author Comment

by:Romacali
ID: 24283907
I tried and I got this:

Compiler Error Message: CS0246: The type or namespace name 'PageView' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 
 
 
Line 12: public partial class evaluation : System.Web.UI.Page
Line 13: {
Line 14:         public PageView lastView; // It should be type PageView
Line 15:
Line 16:         protected void Page_Load(object sender, EventArgs e)
 

 pointing to: Line 14:         public PageView lastView; // It should be type PageView

 
0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24284061
Yeah I don't know what a PageView you need to change it.

What is it?
0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24284063
Its a control of some type
0
 

Author Comment

by:Romacali
ID: 24284125
I have a form, that has on the left side tabs - each tab brings a form on the right hand side, but it is not working I click on the tabs and it doesn't let me see the form..
the only thing that works is when I click submit it goes to the nest form view (page view)

thanks for helping me!! I'm loosing my mind
0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24284195
Can you see all the forms at once? Is Pageview a Form?

    Form lastView  instead of PageView lastView

   Form.Focus wont work you need to hide all the forms and show the one that needs to be active

   Pageview1.Hide ();
   Pageview2.Hide ();
   Pageview3.Hide ();
   Pageview4.Hide ();
   Pageview5.Hide ();

  lastView.Show ();
0
 

Author Comment

by:Romacali
ID: 24307592
I still cannot make it works..
here is what I'm trying to do:
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/functionality/vertical/defaultcs.aspx

The problem is once I click on the pages the form doesn't change.

any idea?
0
 

Author Comment

by:Romacali
ID: 24309416
one more thing:
Compiler Error Message: CS0117: 'ASP.pptradstrip_aspx' does not contain a definition for 'RadTabStrip1_TabClick'

 

Where can I make a definition for 'RadTabStrip1_TabClick' ?

0
 
LVL 12

Expert Comment

by:williamcampbell
ID: 24310022
Woooohoo ..Looks good Roma :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question