3 Answers, 1 is accepted
0
Hello, Deasun,
In order to select a certain tab, you an directly set the RibbonTab.IsSelected property to true in the Load event. Thus, the desired tab will be selected. I have attached a sample project for your reference.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
In order to select a certain tab, you an directly set the RibbonTab.IsSelected property to true in the Load event. Thus, the desired tab will be selected. I have attached a sample project for your reference.
I hope this information helps. If you have any additional questions, please let me know.
Dess
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

Deasun
Top achievements
Rank 1
Iron
answered on 10 Aug 2018, 01:49 PM
Thanks for the reply.
What I was trying to do was stop the user from switching to another tab while they were editing data.
I was hoping to do something in the _CommandTabSelected event.
Like: If Mode = EDIT then CommandTab.Selected = Commandtab.Previoustab
But I dont see any property like that.
After reading some forums it seems I have to keep track of previoustab myself.
After doing that I tried to set the tab back to the tab their editing on.
Something like: rbTBMgr.Commandtab["Tools"].selected = true
Couldnt find anything close to that. Ended up with this:
rbTBMgr.RibbonBarElement.TabStripElement.SelectedItem = rbTBMgr.RibbonBarElement.TabStripElement.Items[1];
But I have to keep track of the index now. I couldnt find a way to reference the tab by name.
Something like:
rbTBMgr.RibbonBarElement.TabStripElement.SelectedItem = rbTBMgr.RibbonBarElement.TabStripElement.Items["Tools"];
Is there no simplier why to do this?
Thanks
Deasun
What I was trying to do was stop the user from switching to another tab while they were editing data.
I was hoping to do something in the _CommandTabSelected event.
Like: If Mode = EDIT then CommandTab.Selected = Commandtab.Previoustab
But I dont see any property like that.
After reading some forums it seems I have to keep track of previoustab myself.
After doing that I tried to set the tab back to the tab their editing on.
Something like: rbTBMgr.Commandtab["Tools"].selected = true
Couldnt find anything close to that. Ended up with this:
rbTBMgr.RibbonBarElement.TabStripElement.SelectedItem = rbTBMgr.RibbonBarElement.TabStripElement.Items[1];
But I have to keep track of the index now. I couldnt find a way to reference the tab by name.
Something like:
rbTBMgr.RibbonBarElement.TabStripElement.SelectedItem = rbTBMgr.RibbonBarElement.TabStripElement.Items["Tools"];
Is there no simplier why to do this?
Thanks
Deasun
0
Accepted
Hello, Deasun,
If you need to block the user from switching to another tab, you can simply handle the RadRibbonBar.CommandTabSelecting event and set the CommandTabSelectingEventArgs.Cancel property to true. In the event args you have access to the new and previous tab so you can check the Text for example:
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
If you need to block the user from switching to another tab, you can simply handle the RadRibbonBar.CommandTabSelecting event and set the CommandTabSelectingEventArgs.Cancel property to true. In the event args you have access to the new and previous tab so you can check the Text for example:
private
void
radRibbonBar1_CommandTabSelecting(
object
sender, CommandTabSelectingEventArgs args)
{
if
(args.NewCommandTab.Text.Contains(
"D"
))
{
args.Cancel =
true
;
}
}
I hope this information helps. If you have any additional questions, please let me know.
Dess
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.