RadContextMenu without icon column in silverlight

4 posts, 0 answers
  1. pawan
    pawan avatar
    6 posts
    Member since:
    Aug 2010

    Posted 13 Jan 2011 Link to this post

    Hi

    how i can show RadContextMenu without icon column in silverlight?

    I am unable to find any solution for below code.

    <

     

    Grid x:Name="LayoutRoot" Background="White">
    <TextBox x:Name="textBox" Width="200" VerticalAlignment="Top">
    <telerik:RadContextMenu.ContextMenu >
    <telerik:RadContextMenu >
    <telerik:RadMenuItem Header="Copy" />
    <telerik:RadMenuItem Header="Paste" />
    <telerik:RadMenuItem Header="Cut" />
    </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
    </TextBox>
    </Grid>

    Is there any property similar to IconColumnWidth  property ?
    IconColumnWidth is used with menu not with RadContextMenu.ContextMenu


    Pawan

     

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 13 Jan 2011 Link to this post

    Hi pawan,

    IconColumnWidth is defined in MenuBase class which is a base class for RadMenu and RadContextMenu. So both classes have IconColumnWidth property.
    The problem is that you are trying to set it to the attached property (e.g. <telerik:RadContextMenu.ContextMenu>)
    Instead you should set it to the instance of RadContextMenu (e.g. <telerik:RadContextMenu IconColumnWidth="0">) the child of <telerik:RadContextMenu.ContextMenu > element

    Let us know if you need more information.

    Regards,
    Hristo
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. pawan
    pawan avatar
    6 posts
    Member since:
    Aug 2010

    Posted 13 Jan 2011 Link to this post

    thanks for reply

    when i added <telerik:RadContextMenu IconColumnWidth="0" >
    it is throwing an error.

    <

     

    UserControl x:Class="SLTest.RadContextMenuTest.RadContextMenuTest2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="White">
    <TextBox x:Name="textBox" Width="200" VerticalAlignment="Top">
    <telerik:RadContextMenu.ContextMenu >
    <telerik:RadContextMenu IconColumnWidth="0" >
    <telerik:RadMenuItem Header="Copy" IsEnabled="False" />
    <telerik:RadMenuItem Header="Paste" />
    <telerik:RadMenuItem Header="Cut" />
    </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
    </TextBox>
    </Grid>
    </
    UserControl>

     

    so tell me where i will modify the code to workable.

    Pawan
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 14 Jan 2011 Link to this post

    Hello pawan,

    This is the correct way to set this property. If you get an error that this property is missing then this mean that you are using older version of RadControls for Silverlight. Please download the latest official version 2010.Q3 to get this property.

    Do not hesitate to write back if you need further assistance.

    Best wishes,
    Hristo
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top