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

How to get the ContextMenu Items inside an ItemTemplate to fill the full available horizontal space

1 Answer 112 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Steffen
Top achievements
Rank 1
Steffen asked on 27 Jul 2017, 01:04 PM

Hello,

i use a split button, which has a RadContextMenu attached to it. Inside the RadContextMenu, there is one RadMenuItem which contains an ItemTemplate with multiple RadCheckBoxes.

How is it possible that the RadCheckBoxes inside the ContentTemplate uses the full available width? So there should be no padding/margin in the ContextMenu and the Checkbox stretches horizontally to use all of the existing space. I uploaded an example of how it looks like right now in the attachments of this post.

 

 

Code:

<telerik:RadButton EnableSplitButton="true" ID="btn4" AutoPostBack="true"runat="server" Text="Example Button Text" OnClientClicked="OnClickedRadButton" CommandName="cmdBt4"   OnClick="btn4_Click" CausesValidation="true">
</telerik:RadButton>
<telerik:RadContextMenu id="rcmBtn4" runat="server">
   <Items>
      <telerik:RadMenuItem>
         <ItemTemplate>
            <p>
               <telerik:RadCheckBox runat="server" ID="rcb1" CausesValidation="false" Checked="true" Text="als Excel-Datei (.xlsx) exportieren" AutoPostBack="false" />
            </p>
            <p>
               <telerik:RadCheckBox runat="server" ID="rcb2" CausesValidation="false" Checked="true" Text="Checkbox Text 2" AutoPostBack="false" />
            </p>
         </ItemTemplate>
      </telerik:RadMenuItem>
   </Items>
</telerik:RadContextMenu>

1 Answer, 1 is accepted

Sort by
0
Steffen
Top achievements
Rank 1
answered on 27 Jul 2017, 01:15 PM

This thread is a duplicate of 

http://www.telerik.com/forums/how-to-align-the-width-and-height-of-an-radmenuitem-and-an-itemtemplate-to-match-the-size-of-the-containing-controls

 

An admin can delete it.

Tags
Menu
Asked by
Steffen
Top achievements
Rank 1
Answers by
Steffen
Top achievements
Rank 1
Share this question
or