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

RadMenu In Usercontrol throws 4004 error

7 Answers 67 Views
Menu
This is a migrated thread and some comments may be shown as answers.
anirudha
Top achievements
Rank 1
anirudha asked on 20 Jan 2009, 04:28 AM

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

7 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 20 Jan 2009, 10:01 AM
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.
0
anirudha
Top achievements
Rank 1
answered on 21 Jan 2009, 04:35 AM
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
0
Hristo
Telerik team
answered on 21 Jan 2009, 07:28 AM
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.
0
anirudha
Top achievements
Rank 1
answered on 21 Jan 2009, 09:16 AM

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

0
Serrin
Top achievements
Rank 1
answered on 21 Jan 2009, 02:06 PM
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).
0
Hristo
Telerik team
answered on 21 Jan 2009, 06:26 PM
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.
0
anirudha
Top achievements
Rank 1
answered on 22 Jan 2009, 10:49 AM
Hi Serrin,
I have tried by setting the  X:name property but sorry the problem still persists.
Thanks,
Andy
Tags
Menu
Asked by
anirudha
Top achievements
Rank 1
Answers by
Hristo
Telerik team
anirudha
Top achievements
Rank 1
Serrin
Top achievements
Rank 1
Share this question
or