This is a migrated thread and some comments may be shown as answers.

Rad Controls with dundas chart

5 Answers 91 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
sanjeeb
Top achievements
Rank 1
sanjeeb asked on 09 Feb 2009, 06:10 PM
My program will have two tabs.One tab(pageview) will display dundas chart.when user clicks on a chart, same chart will be created in another tab(pageview).How to do this??? 

5 Answers, 1 is accepted

Sort by
0
sanjeeb
Top achievements
Rank 1
answered on 10 Feb 2009, 09:08 AM
It will be OK if you guide me how to add text box in a pageview through .cs file.
0
Serrin
Top achievements
Rank 1
answered on 10 Feb 2009, 07:25 PM
Hey Sanjeeb,

Check out the following link, defines copying controls in a manner like you need:

http://forums.asp.net/t/617980.aspx

Can't guarantee it working on your chart, but it is the best answer I found (and copies regular textboxes over), just be sure when you are adding to the second multi page's controls collection, you cast the returned object as a Control.  I did something like this:

    protected void Button1_Click(object sender, EventArgs e)  
    {  
        ControlCollection newCollection = multipage1.Controls;  
        foreach (Object control in newCollection)  
        {  
            multipage2.Controls.Add((Control)CloneControls(control));  
        }         
    } 

Cheers!
0
sanjeeb
Top achievements
Rank 1
answered on 12 Feb 2009, 09:02 AM
Hi Serrin,

                  Thank you for your help.But the code and link you provided me is not the exact answer to my question.Forget my first question(regarding dundas chart), just try to answer my second question.If i get the answer to  the second question(regarding adding text box) i will be able to solve the first one.I am no getting what is problem with below code:

            RadTabStrip radTabStrip = new RadTabStrip();
            RadMultiPage RadMultiPage1 = new RadMultiPage();
           
            PageView pv1 = new PageView();
            PageView pv2 = new PageView();
            TextBox tb1 = new TextBox();
            tb1.ID = "tb1";

            pv1.ID = "pv1";
            pv2.ID = "pv2";
          
            Tab t1 = new Tab();
            t1.ID = "t1";
            t1.Text = "Average";
            t1.PageViewID = "pv1";

            Tab t2 = new Tab();
            t2.ID = "t2";
            t2.Text = "Details";
            t2.PageViewID = "pv2";

         
                   
            pv1.Controls.Add(tb1);    /////  this does not work
            
            radTabStrip.Tabs.Add(t1);
            radTabStrip.Tabs.Add(t2);

            RadMultiPage1.ID = "RadMultiPage1";
            RadMultiPage1.PageViews.Add(pv1);
            RadMultiPage1.PageViews.Add(pv2);
            pv1.Selected = true;
            pv1.TabIndex =0;

           radTabStrip.MultiPageID = "RadMultiPage1";
           this.Controls.Add(radTabStrip);
          this.Controls.Add(RadMultiPage1);

          
Though i have solved this problem.I have created radtabstrip,multipage,pageview  statically and then through code behind i have added controls.


                       
0
Paul
Telerik team
answered on 12 Feb 2009, 09:37 AM
Hi sanjeeb,

Here's your modified code snippet that works as expected.

RadTabStrip radTabStrip = new RadTabStrip(); 
RadMultiPage RadMultiPage1 = new RadMultiPage(); 
 
RadPageView pv1 = new RadPageView(); 
RadPageView pv2 = new RadPageView(); 
TextBox tb1 = new TextBox(); 
tb1.ID = "tb1"
 
pv1.ID = "pv1"
pv2.ID = "pv2"
 
RadTab t1 = new RadTab(); 
t1.Text = "Average"
t1.PageViewID = "pv1"
 
RadTab t2 = new RadTab(); 
t2.Text = "Details"
t2.PageViewID = "pv2"
 
pv1.Controls.Add(tb1); 
 
radTabStrip.Tabs.Add(t1); 
radTabStrip.Tabs.Add(t2); 
 
RadMultiPage1.ID = "RadMultiPage1"
RadMultiPage1.PageViews.Add(pv1); 
RadMultiPage1.PageViews.Add(pv2); 
pv1.Selected = true
pv1.TabIndex = 0; 
 
radTabStrip.MultiPageID = "RadMultiPage1"
form1.Controls.Add(radTabStrip); 
form1.Controls.Add(RadMultiPage1); 


Sincerely yours,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
sanjeeb
Top achievements
Rank 1
answered on 12 Feb 2009, 12:57 PM
Thank you Paul, Now i got the answer!!!!!!!!!!!!!!1


Tags
TabStrip
Asked by
sanjeeb
Top achievements
Rank 1
Answers by
sanjeeb
Top achievements
Rank 1
Serrin
Top achievements
Rank 1
Paul
Telerik team
Share this question
or