Hi ,
I am trying to add one custom control in custom group in Ribbon. I am able to add custom group and custom control but control is always disabled. Please find my code below. I have found lots of post but any of them is not working.
Any Idea?
<?xml version="1.0" encoding="utf-8"?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"><CustomAction
Id="SharePoint.Ribbon.NewControlInExistingGroup"
Location="CommandUI.Ribbon"><CommandUIExtension><CommandUIDefinitions><CommandUIDefinition Location="Ribbon.Templates._children"><GroupTemplate Id="Reservations.Templates"><Layout Title="Large"><Section Type="OneRow"><Row><ControlRef TemplateAlias="c1" DisplayMode="Large" /> </Row></Section></Layout></GroupTemplate></CommandUIDefinition><CommandUIDefinition Location="Ribbon.Image.Image.Scaling._children"><MaxSize Id="Ribbon.ListForm.Display.CustomActionGroup.MaxSize"
Sequence="55"
GroupId="Ribbon.Image.Image.ImageRatio"
Size="Large" /></CommandUIDefinition><CommandUIDefinition Location="Ribbon.Image.Image.Groups._children"><Group Id="Ribbon.Image.Image.ImageRatio" Title="Image Ratio!!!" Template="Reservations.Templates" Command="ImageRatio.Command" Sequence="45" ><Controls Id="Ribbon.Image.Image.ImageRatio.Controls" ><FlyoutAnchor
Id="Ribbon.Image.Image.ImageRatio.ImageSize"
Alt="Image Ratio"
Sequence="100"
Command="SayHello"
Image32by32="/_layouts/15/images/placeholder32x32.png"
PopulateDynamically="false"
LabelText="Image Size"
ToolTipTitle="Image Size"
ToolTipDescription="Set Image Size"
TemplateAlias="c1"><Menu Id="Ribbon.Image.Image.ImageRatio.DropDown.Menu"><MenuSection
Id="Ribbon.Image.Image.ImageRatio.DropDown.Section"
Sequence="10"
DisplayMode="Menu16"><Controls Id="Ribbon.Image.Image.ImageRatio.DropDown.Section.Controls"><Button
Id="Ribbon.Image.Image.ImageRatio.DropDown.Btn1"
Command="ImageSize30"
Sequence="10"
Alt="30% Image size"
LabelText="30% Image size"/><Button
Id="Ribbon.Image.Image.ImageRatio.DropDown.Btn2"
Command="ImageSize50"
Sequence="20"
Alt="50% Image size"
LabelText="50% Image size"/><Button
Id="Ribbon.Image.Image.ImageRatio.DropDown.Btn3"
Command="ImageSize100"
Sequence="30"
Alt="100% Image size"
LabelText="100% Image size"/></Controls></MenuSection></Menu></FlyoutAnchor></Controls></Group></CommandUIDefinition></CommandUIDefinitions><CommandUIHandlers><CommandUIHandler
Command="ImageRatio.Command" CommandAction="javascript:alert('My Custom Action');" EnabledScript="javascript:return true;" /><CommandUIHandler Command="CustomActionButtonCommand" CommandAction="javascript:alert('My Custom Action');" EnabledScript="javascript:return true;" /><CommandUIHandler Command="ImageSize30" CommandAction="javascript:alert('30%');" EnabledScript="javascript:return true;" /><CommandUIHandler Command="ImageSize50" CommandAction="javascript:alert('50%');" EnabledScript="javascript:return true;" /><CommandUIHandler Command="ImageSize100" CommandAction="javascript:alert('50%');" EnabledScript="javascript:return true;" /></CommandUIHandlers></CommandUIExtension></CustomAction></Elements>