We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Selecting TabPageAdv after adding to TabControlAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

34926 Sep 20,2005 03:20 AM UTC Sep 27,2005 04:31 PM UTC WinForms 9
loading
Tags: Tools
Taj
Asked On September 20, 2005 03:20 AM UTC

Hi, I am adding Tabs to TabControlAdv and I want to select the new TabPage that is created on the fly, but TabControlAdv always sets focus on first TabPage. I tried using SelectedIndex, SelectedTab properties of TabControlAdv but none seems to work. I even tried page.Select() but that didn''t work either. Are there any other properties to select the page that gets created programmatically? Thanks

Mano J [Syncfusion]
Replied On September 20, 2005 05:37 AM UTC

Hi Taj, Please try the following to make focus to the dynamically created tab. TabPageAdv tabpage = new TabPageAdv(); tabpage.Text = "TabPage"; this.tabControlAdv1.TabPages.Add(tabpage); // To select the TabPage this.tabControlAdv1.SelectedTab = tabpage; Thanks for using Syncfusion products. Regards, Mano

Taj
Replied On September 20, 2005 04:11 PM UTC

Hi Mano, As I said earlier, SelectedTab didn''t work for me. I noticed that after using this.tabControlAdv1.TabPages.Add(tabPage), nothing executes after that line. It happens only when I call a method to create tab asynchronously using a delegate. I have attached an example for your reference. (Syncfusion version: 3.0.1.0) Thanks >Hi Taj, > >Please try the following to make focus to the dynamically created tab. > >TabPageAdv tabpage = new TabPageAdv(); >tabpage.Text = "TabPage"; >this.tabControlAdv1.TabPages.Add(tabpage); > >// To select the TabPage this.tabControlAdv1.SelectedTab = tabpage; > >Thanks for using Syncfusion products. > >Regards, >Mano SyncTabEx_9519.zip

Mano J [Syncfusion]
Replied On September 21, 2005 04:03 AM UTC

Hi Jim, Please modify the code in the button click event as follows, private void button1_Click(object sender, System.EventArgs e) { if( this.createNewTabEvent != null ) { // this.createNewTabEvent.BeginInvoke(null,null); this.createNewTabEvent(); } } Please refer to the modified sample and let me know if this works for you. Thanks for using Syncfusion products. Regards, Mano Syncfusion, Inc. SyncTabEx_9975.zip

Taj
Replied On September 21, 2005 06:54 AM UTC

Hi Mano, I know that the code works if the method is called directly or indirectly using a delegate, but my project requires me to make the call asyncronously and as you must have noticed the code never makes it beyond this line in my sample code. this.tabControlAdv1.Controls.Add( newTab ); I would like to know why does it not work with asyncronous calls. Thanks. >Hi Jim, > >Please modify the code in the button click event as follows, > >private void button1_Click(object sender, System.EventArgs e) >{ > if( this.createNewTabEvent != null ) > { > // this.createNewTabEvent.BeginInvoke(null,null); > this.createNewTabEvent(); > } >} > >Please refer to the modified sample and let me know if this works for you. > >Thanks for using Syncfusion products. > >Regards, >Mano >Syncfusion, Inc. > > > > >SyncTabEx_9975.zip > >

Mano J [Syncfusion]
Replied On September 21, 2005 09:56 AM UTC

Hi Taj, You could use the following coding to execute the delegate asynchronously, IAsyncResult result = BeginInvoke(new MethodInvoker(this.createNewTabEvent)); Please refer to the modified sample attached. Regards, Mano SyncTabEx_modified_2_865.zip

Taj
Replied On September 21, 2005 05:23 PM UTC

Hi Mano, Lets say I want to pass some parameters to my method that is invoked asyncronously, then how would I address the problem. ("MethodInvoker" won''t work in that case.) for e.g. private delegate void CreateNewTabEvent( long listID ); -- Taj >Hi Taj, > >You could use the following coding to execute the delegate asynchronously, > >IAsyncResult result = BeginInvoke(new MethodInvoker(this.createNewTabEvent)); > >Please refer to the modified sample attached. > >Regards, >Mano > >SyncTabEx_modified_2_865.zip > >

Administrator [Syncfusion]
Replied On September 23, 2005 09:01 PM UTC

Hi, Let me ask this for one more time, I am not looking for work around here. I would be pleased if somebody at Syncfusion can answer why TabPageAdv does not get selected in the sample I had send.

Mano J [Syncfusion]
Replied On September 27, 2005 11:06 AM UTC

Hi Taj, I apologize for the delay in responding. I am looking into this issue and will update this thread at the earliest. Thank you for your patience. Best regards, Mano

Mano J [Syncfusion]
Replied On September 27, 2005 04:31 PM UTC

Hi Taj, Please refer to the modified sample attached below. I have passed a parameter to the method called asynchronously. I have used BeginInvoke and EndInvoke method to invoke and ends the method respectively. Please refer to it and let me know if this meets your requirements. Thanks for using Syncfusion products. Regards, Mano TabControlAdv_Delegate

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;