RadMenu In Usercontrol throws 4004 error

8 posts, 0 answers
  1. anirudha
    anirudha avatar
    17 posts
    Member since:
    Jan 2009

    Posted 19 Jan 2009 Link to this post

    Hi I am trying to use RADMenu In Silverlight 2.0 User Control but it's throwing error 4004.

     

     

     

    <telerikNavigation:RadMenu>

     

     

     

     

     

     

    <telerikNavigation:RadMenuItem Header="Test" ></telerikNavigation:RadMenuItem>

     

     

     

     

     

     

    </telerikNavigation:RadMenu>

     

     

     

    After inclusion of this it always throws error  4004.

    Thanks,
    Andy

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 20 Jan 2009 Link to this post

    Hi Andy,

    Can you elaborate more on this issue?
    Do you use the latest version of our assemblies?
    Have you added reference to Telerik.Windows.Controls and Telerik.Windows.Controls.Navigation assemblies?

    Waiting for your reply?


    All the best,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. anirudha
    anirudha avatar
    17 posts
    Member since:
    Jan 2009

    Posted 20 Jan 2009 Link to this post

    Hi Hristo ,
    i am using the Telerik.Windows.Controls.dll of vsersion."2008.3.1217.1020".
    i have added reference to both Telerik.Windows.Controls and Telerik.Windows.Controls.Navigation .

    The Radmenu controls works fine if used in single xaml page.
    But its throwing error 4004 when i am trying to place it inside a master page.


    Thanks,
    Andy
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 21 Jan 2009 Link to this post

    Hi Andy,

    I'll really appreciate a simple project demonstrating this issue.
    My guess is that the problem is in this master page.

    Waiting for your reply.

    Sincerely yours,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. anirudha
    anirudha avatar
    17 posts
    Member since:
    Jan 2009

    Posted 21 Jan 2009 Link to this post

    hi Hristo,
    Please find the code of Master.xaml below.
    <

     

    UserControl xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

     

    xmlns

     

    :telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"

     

    x

     

    :Class="ERAProject.MainMaster"

     

     

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

     

     

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

     

     

    xmlns:a="clr-namespace:ERAProject.Themes"

     

     

    xmlns:d="http://schemas.openxmlformats.org/markup-compatibility/2006"

     

     

    Width="auto" Height="auto">

     

     

     

    <Grid x:Name="LayoutRoot" Background="Silver" ShowGridLines="True">

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition Height="Auto" ></RowDefinition>

     

     

     

    <RowDefinition Height="*" MaxHeight="40" MinHeight="40"></RowDefinition>

     

     

     

    <RowDefinition Height="Auto" ></RowDefinition>

     

     

     

    <RowDefinition Height="50" ></RowDefinition>

     

     

     

    <RowDefinition Height="Auto" ></RowDefinition>

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto" MinWidth="100"></ColumnDefinition>

     

     

     

    <ColumnDefinition Width="*" ></ColumnDefinition>

     

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

     

     

    <StackPanel >

     

     

     

    <TextBlock x:Name="txtProjName" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" FontSize="16" FontFamily="Verdana" Text="SampleTest" ></TextBlock>

     

     

     

     

    </StackPanel >

     

     

     

    <telerikNavigation:RadMenu>

     

     

     

    <telerikNavigation:RadMenuItem Header="OrgDetails" Click="RadMenuItem_Click"></telerikNavigation:RadMenuItem>

     

     

     

    <telerikNavigation:RadMenuItem Header="OrgLevels" Click="RadMenuItem_Click_1"></telerikNavigation:RadMenuItem>

     

     

     

    <telerikNavigation:RadMenuItem Header="OrgOrgDeptDetails" Click="RadMenuItem_Click_2"></telerikNavigation:RadMenuItem>

     

     

     

    <telerikNavigation:RadMenuItem Header="OrgDetails" Click="RadMenuItem_Click_3"></telerikNavigation:RadMenuItem>

     

     

     

     

    </telerikNavigation:RadMenu>

     

     

     

    <StackPanel x:Name="stk" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center">

     

     

     

     

     

    </StackPanel>

     

     

     

    </Grid>

     

    </

     

    UserControl>
    ----------------------------------------------------------------------------------------------------
    Master.xaml.cs code as below.
    ----------------------------------------------------------------------------------------------------

     

    using

     

    System.Collections.Generic;

     

     

     

    using

     

    System.Linq;

     

     

     

    using

     

    System.Net;

     

     

     

    using

     

    System.Windows;

     

     

     

    using

     

    System.Windows.Controls;

     

     

     

    using

     

    System.Windows.Documents;

     

     

     

    using

     

    System.Windows.Input;

     

     

     

    using

     

    System.Windows.Media;

     

     

     

    using

     

    System.Windows.Media.Animation;

     

     

     

    using

     

    System.Windows.Shapes;

     

     

     

    using

     

    Telerik.Windows.Controls;

     

     

     

     

     

    namespace

     

    ERAProject

     

    {

     

    public partial class MainMaster : UserControl

     

     

     

     

    {

     

    public int Var;

     

     

    public MainMaster()

     

    {

    InitializeComponent();

     

    this.Loaded += new RoutedEventHandler(MainMaster_Loaded);

     

    }

     

    void MainMaster_Loaded(object sender, RoutedEventArgs e)

     

    {

    stk.Children.Clear();

    Var = 2;

    NavigateRequest(Var);

     

     

    //throw new NotImplementedException();

     

     

     

     

    }

     

     

    private void NavigateRequest(int w)

     

    {

     

     

    if (w > 0)

     

    {

     

    switch (w)

     

    {

     

    case 1: stk.Children.Add(new Login());

     

    stk.Width = 800;

    stk.Height = 1000;

     

    break;

     

     

    case 2: stk.Children.Add(new OrganizationDetails());

     

    stk.Width = 1100;

    stk.Height = 1600;

     

    break;

     

     

    case 3: stk.Children.Add(new OrganizationLevel());

     

    stk.Width = 1200;

    stk.Height = 1600;

     

    break;

     

     

    case 4: stk.Children.Add(new ServiceCellDetails());

     

     

    stk.Width = 1200;

    stk.Height = 1600;

     

     

    break;

     

     

    case 5: stk.Children.Add(new ServiceCellRelationMapping());

     

    stk.Width = 1000;

    stk.Height = 1000;

     

    break;

     

     

    case 7: stk.Children.Add(new AddServiceCellDetails());

     

    stk.Width = 1200;

    stk.Height = 1000;

     

    break;

     

     

    case 8: stk.Children.Add(new OrganizationLevel());

     

    stk.Width = 1200;

    stk.Height = 1000;

     

    break;

     

     

    default: this.Content = new OrganizationLevel();

     

    stk.Width = 800;

    stk.Height = 1000;

     

    break;

     

    }

    }

    }

     

     

     

     

     

     

     

     

     

     

    private void RadMenuItem_Click(object sender, RoutedEventArgs e)

     

    {

    stk.Children.Clear();

    Var = 5 ;

    NavigateRequest(Var);

    }

     

    private void RadMenuItem_Click_1(object sender, RoutedEventArgs e)

     

    {

    stk.Children.Clear();

    Var = 4;

    NavigateRequest(Var);

    }

     

    private void RadMenuItem_Click_2(object sender, RoutedEventArgs e)

     

    {

    stk.Children.Clear();

    Var = 4;

    NavigateRequest(Var);

    }

     

    private void RadMenuItem_Click_3(object sender, RoutedEventArgs e)

     

    {

    stk.Children.Clear();

    Var = 2;

    NavigateRequest(Var);

    }

     

     

     

     

    }

    }

     

    is there any way with which i can send you the sample project as zip file.
    Thanks,
    Andy

  7. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 21 Jan 2009 Link to this post

    Hey Anirudha,

    Does it make any difference if you add an x:Name="Whatever" to the menu?  I know I've had issues before with menu when not providing an x:Name, but I just tested it in a RadNavigation environment in a nested page and had no issues.  Hopefully this helps, but if not I am sure Hristo will find the answer (he's already earned a thank you in my About page for helping me to get ContextMenu working like a charm).
  8. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 21 Jan 2009 Link to this post

    Hi Andy,

    I was able to build and run your project and it is working fine. Both in runtime and in VS Design surface.
    In order to attach project you should open a support ticket.
    Sometimes VS design time messed up. But a simple VS restart fix it.

    If you could send me the whole project I may be able to track down the problem.
    Sorry for the inconvenience.

    Best wishes,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. anirudha
    anirudha avatar
    17 posts
    Member since:
    Jan 2009

    Posted 22 Jan 2009 Link to this post

    Hi Serrin,
    I have tried by setting the  X:name property but sorry the problem still persists.
    Thanks,
    Andy
Back to Top
DevCraft banner