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

Enable disable application menu items

7 Answers 97 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Abhilash
Top achievements
Rank 1
Abhilash asked on 16 Jan 2013, 06:02 AM
Hello ,

I want to enable/disable rad ribbon applicationmenu items. I tried .Enabled property.but not working.
Please provide me a solution.

Thanks
Abhi

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 16 Jan 2013, 06:49 AM
Hi,

Try the following code snippet to achieve your scenario.

JS:
<script type="text/javascript">
 function OnClientClick() {
        var menu = $find('<%= RadRibbonBar1.ClientID %>')._applicationMenuDropDown;
        var item1 = menu.get_items().getItem(0);
        //get the first item from the application menu
        //disables the first item from the application menu
        item1.set_enabled(false);
    }
</script>

Please take a look into this documentation for more information.

Hope this helps.

Regards,
Princy.
0
Abhilash
Top achievements
Rank 1
answered on 25 Jan 2013, 10:00 AM
Thank you Princy,

It worked fine. Now the disabled menu's image is 'X' mark. Can I retain its original image when it is in disabled mode.

Thank you
Abhilash
0
Abhilash
Top achievements
Rank 1
answered on 04 Feb 2013, 05:17 AM
Hello,

Any hope?
0
Abhilash
Top achievements
Rank 1
answered on 04 Feb 2013, 10:12 AM
Hi
I want to disable chkFbar .
  <telerik:RibbonBarGroup Text="Show/Hide" EnableLauncher="false">
                                <Items>
                                    <telerik:RibbonBarControlGroup Orientation="Vertical">
                                        <telerik:RibbonBarTemplateItem>                                  
                                            <telerik:RadButton ID="chkFbar" ToggleType="CheckBox" ButtonType="ToggleButton"
                                                runat="server" Text="Formula" Value="FBAR">
                                            </telerik:RadButton>
                                        </telerik:RibbonBarTemplateItem>
                                    </telerik:RibbonBarControlGroup>
                                </Items>
                            </telerik:RibbonBarGroup>

I tried  Chk = $find("<%= chkFbar.ClientID %>");
          Chk.disable();
But not working.Plz help me.

Thank you
0
Princy
Top achievements
Rank 1
answered on 04 Feb 2013, 11:57 AM
Hi,

Try the following javascript.
JS:
var Chk = $find("<%= chkFbar.ClientID %>");
Chk.set_enabled(false);

Thanks,
Princy
0
Abhilash
Top achievements
Rank 1
answered on 22 Feb 2013, 11:35 AM
Hello Princy,

Thank you for your reply. I am using Q3. Can I achieve the menu enable/disable functionality using .Enabled property.

Thank you
Abhilash
0
Abhilash
Top achievements
Rank 1
answered on 05 Oct 2013, 09:21 AM
Hello Princy,

I want to access rad ribbonbar items in client side and set/get its values. Please help me to achieve this.
I want to do the following things.
1.Get and Set values to ddlText
2.Get and Set values to cbSize

My rad ribbonbar looks like follows.

 <telerik:RibbonBarGroup Text="Font" EnableLauncher="false" Value="Font">
                        <Items>
                            <telerik:RibbonBarControlGroup Orientation="Vertical">
                                <telerik:RibbonBarControlGroup Orientation="Horizontal" >
                                    <telerik:RibbonBarDropDown ID="ddlText"   Width="97" >
                                        <Items>
                                            <telerik:RibbonBarListItem Text="Arial" />
                                            <telerik:RibbonBarListItem Text="Calibri (body)"  Selected="true" />
                                            <telerik:RibbonBarListItem Text="Comic Sans" />
                                            <telerik:RibbonBarListItem Text="Tahoma" />
                                            <telerik:RibbonBarListItem Text="Verdana" />
                                        </Items>
                                    </telerik:RibbonBarDropDown>
                                    <telerik:RibbonBarComboBox ID="cbSize"  Width="40" >
                                        <Items>
                                            <telerik:RibbonBarListItem Text="8"  />
                                            <telerik:RibbonBarListItem Text="9" />
                                            <telerik:RibbonBarListItem Text="10" Selected="true" />
                                            <telerik:RibbonBarListItem Text="11" />
                                            <telerik:RibbonBarListItem Text="12" />
                                            <telerik:RibbonBarListItem Text="14" />
                                            <telerik:RibbonBarListItem Text="16" />
                                            <telerik:RibbonBarListItem Text="18" />
                                            <telerik:RibbonBarListItem Text="20" />
                                            <telerik:RibbonBarListItem Text="22" />
                                            <telerik:RibbonBarListItem Text="24" />
                                            <telerik:RibbonBarListItem Text="26" />
                                            <telerik:RibbonBarListItem Text="28" />
                                        </Items>
                                    </telerik:RibbonBarComboBox>
                                </telerik:RibbonBarControlGroup>
                                <telerik:RibbonBarControlGroup Orientation="Horizontal">
                                    <telerik:RibbonBarToggleButton  ID="tgleBold" Size="Small" Text="Bold" ImageUrl="images/icons/formD-Small-Icon-Bold.png"
                                        DisabledImageUrl="images/icons/formD-Small-Icon-Bold.png" Value="BOLD" />
                                    <telerik:RibbonBarToggleButton Size="Small" Text="Italic" ImageUrl="images/icons/formD-Small-Icon-Italic.png"
                                        DisabledImageUrl="images/icons/formD-Small-Icon-Italic.png" Value="ITALIC" />
                                    <telerik:RibbonBarToggleButton Size="Small" Text="Underline" ImageUrl="images/icons/formD-Small-Icon-Underline.png"
                                        DisabledImageUrl="images/icons/formD-Small-Icon-Underline.png" Value="UNDERLINE" />
                                    <telerik:RibbonBarToggleButton Size="Small" Text="Strikethrough" ImageUrl="images/icons/formD-Small-Icon-Strike.png"
                                        DisabledImageUrl="images/icons/formD-Small-Icon-Strike.png" Value="STRIKE" />
                                    <telerik:RibbonBarToggleList>
                                        <ToggleButtons>
                                            <telerik:RibbonBarToggleButton Size="Small" Text="Superscript" ImageUrl="images/icons/Superscript.png">
                                            </telerik:RibbonBarToggleButton>
                                            <telerik:RibbonBarToggleButton Size="Small" Text="Subscript" ImageUrl="images/icons/Subscript.png">
                                            </telerik:RibbonBarToggleButton>
                                        </ToggleButtons>
                                    </telerik:RibbonBarToggleList>
                                </telerik:RibbonBarControlGroup>
                            </telerik:RibbonBarControlGroup>
                        </Items>
                    </telerik:RibbonBarGroup>

Expecting your fast response.
Thank you
Abhi
Tags
RibbonBar
Asked by
Abhilash
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Abhilash
Top achievements
Rank 1
Abhilash
Top achievements
Rank 1
Share this question
or