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

RadRibbonBar ContextualTabGroup

5 Answers 69 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Brigite
Top achievements
Rank 1
Brigite asked on 13 Jan 2012, 04:41 PM

Hi,

I am using the ASP.NET component RadRibbonBar(latest version - Q3 2011)  and I have a question about the usage of the ContextualTabGroup.

How can I  activate and deactivate a ContextualTabGroup depending on the options selected in a Tab (RibbonBarButton) ?

Since is not possible to have an ID to the RibbonBarContextualTabGroup, I wonder how I can activate or deactivate the component in the server-side ?

Best regards,

Brigite Pedro

5 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 18 Jan 2012, 01:18 PM
Hello Brigite,

You can use the Active property of the RibbonBarContextualTabGroup and set it to false on the server side (see the code below):
<telerik:RadButton runat="server" ID="button1" Text="buuton1" OnClick="button1_Click">
    </telerik:RadButton>
    <br />
    <telerik:RadRibbonBar ID="ribbon1" runat="server" Skin="Outlook">
        <ContextualTabGroups>
            <telerik:RibbonBarContextualTabGroup Text="TAB1" Active="true">
                <Tabs>
                    <telerik:RibbonBarTab Text="tab1">
                    </telerik:RibbonBarTab>
                    <telerik:RibbonBarTab Text="tab2">
                    </telerik:RibbonBarTab>
                    <telerik:RibbonBarTab Text="tab2">
                    </telerik:RibbonBarTab>
                </Tabs>
            </telerik:RibbonBarContextualTabGroup>
            <telerik:RibbonBarContextualTabGroup Text="TAB2" Active="true">
                <Tabs>
                    <telerik:RibbonBarTab Text="tab1">
                    </telerik:RibbonBarTab>
                    <telerik:RibbonBarTab Text="tab2">
                    </telerik:RibbonBarTab>
                    <telerik:RibbonBarTab Text="tab2">
                    </telerik:RibbonBarTab>
                </Tabs>
            </telerik:RibbonBarContextualTabGroup>
        </ContextualTabGroups>
    </telerik:RadRibbonBar>
 
code behind:
protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void button1_Click(object sender, EventArgs e)
    {
        ribbon1.ContextualTabGroups[0].Active = false;
    }

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
guy
Top achievements
Rank 1
answered on 02 Dec 2015, 08:29 AM

hi,

i have another question about this post.

there is way to activate / deactivate the contextual tabs without refresh the whole page, like in AJAX or something ?

0
Veselin Tsvetanov
Telerik team
answered on 03 Dec 2015, 11:38 AM
Hi Guy,

You can easily activate or deactivate tabs in a RibbonBarContextualTabGroup through the RibbonBar's client-side API by using their set_enabled(bool) method. Below you can find possible implementation showing how to disable the second Tab of the first TabGroup by handling OnClientClicking event of a RadButton:

function onClientButtonClicking(sender, args) {
    var ribbonBar = $find("<%= ribbon1.ClientID %>");
    var tabGroup = ribbonBar.findContextualTabGroupByText("TAB1");
    var tabToDisable = tabGroup.get_tabs()[1];
 
    if (tabToDisable) {
        tabToDisable.set_enabled(false);
    }
 
    args.set_cancel(true);
}

If you have any further questions, please do not hesitate to contact us.

Regards,
Veselin Tsvetanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
guy
Top achievements
Rank 1
answered on 03 Dec 2015, 02:09 PM
Thanks a lot, very helpful
0
Veselin Tsvetanov
Telerik team
answered on 07 Dec 2015, 07:42 AM
Hi Guy,

I am glad we were able to help.

Regards,
Veselin Tsvetanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RibbonBar
Asked by
Brigite
Top achievements
Rank 1
Answers by
Kate
Telerik team
guy
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or