0

I'm trying to insert a Calendar in WPF application by inserting calendar tags but I'm getting this error?

The type 'calendar' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built Here is the code :-

<Window x:Class="HomeExpenseCalculator.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="Window1" Height="395.516" Width="445.511">
    <Grid>
        <Label Height="25" Name="label1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="88" FontSize="14" Margin="14,15,0,0" Background="White">Person</Label>
        <ComboBox Height="23" Margin="159.984,15,95.546,0" Name="comboBox1" VerticalAlignment="Top">
            <ComboBoxItem>Pankaj</ComboBoxItem>
            <ComboBoxItem>Shad</ComboBoxItem>
            <ComboBoxItem>Kartik</ComboBoxItem>
            <ComboBoxItem>Abhinav</ComboBoxItem>
            <ComboBoxItem>Rahul</ComboBoxItem>
        </ComboBox>
        <Label Height="28" Margin="3,63.327,0,0" Name="label2" VerticalAlignment="Top"   HorizontalAlignment="Left" Width="99" FontSize="12" Background="White">Stuff   Purchased</Label>
        <TextBox Height="63" Margin="111,48,38,0" Name="textBox1" VerticalAlignment="Top" />
        <Calendar> </Calendar>
    </Grid>
</Window>
Shad Khan
  • 119
  • 4
  • 12

4 Answers4

2

I created a new window and added the calender control with no errors. Here is what the XAML looked like:

<Window x:Class="StackOverflow.TestWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="TestWindow" Height="300" Width="300">
    <Grid>
        <Calendar />
    </Grid>
</Window>
TrueEddie
  • 2,183
  • 2
  • 26
  • 36
  • I've posted the code above. Please take a look. The Calendar tag is not working... – Shad Khan Sep 17 '13 at 14:02
  • I copied your code exactly, and pasted it into a test project and had no issues at all. – TrueEddie Sep 17 '13 at 14:08
  • Maybe try restarting Visual Studio. Other that that I'm not sure what could be wrong, the code looks just fine. Unless its like the others are saying and you are missing the assembly reference (which should be already included by default). – TrueEddie Sep 17 '13 at 14:11
  • Mine gives two errors Error 1 The tag 'Calendar' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 16 Position 10 2 The type 'Calendar' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. – Shad Khan Sep 17 '13 at 14:13
  • Is this a WPF application? Or are you adding a WPF Window to a WinForms application? – TrueEddie Sep 17 '13 at 14:18
  • Try creating a new window and just putting the calendar control in it. If that doesn't work, try creating a new test project and placing the calender in the window for that project. It should work in at least the latter instance and then compare with what you have. If it still isn't working at all, then there must be a bigger problem that I won't be able to diagnose. – TrueEddie Sep 17 '13 at 14:31
  • I created a new project. I'm still not able to insert calendar. Actually all the common controls in toolbox are coming as grey. I can't drag and drop any of them. – Shad Khan Sep 17 '13 at 15:03
  • Try resetting your toolbox like indicated by this post: http://stackoverflow.com/questions/8871531/visual-studio-2010-toolbox-controls-disabled-or-inactive – TrueEddie Sep 17 '13 at 15:06
  • No luck!. I think I'll have to reinstall the Visual Studio. There seems to be some serious problem. – Shad Khan Sep 17 '13 at 15:18
  • Someone commented above. I think calendar and datepicker is not available in .net 3.5 – Shad Khan Sep 17 '13 at 15:23
0

Please be more detailed in your question.

This error means you don't have the correct assembly.

See: WPF assembly reference missing - project still building

Community
  • 1
  • 1
JK84
  • 325
  • 1
  • 2
  • 13
0

Perhaps you don't have a reference to the correct namespace in the XAML? (i.e. xmlns=...).

You need to reference the namespace that the calendar control is in for it to work...

  • what should I insert here ? xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" – Shad Khan Sep 17 '13 at 13:44
0

use Calendar instead of 'calendar'

Microsoft DN
  • 9,706
  • 10
  • 51
  • 71
  • Error 1 The tag 'Calendar' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 16 Position 10. C:\Documents and Settings\Shad\My Documents\Visual Studio 2008\Projects\HomeExpenseCalculator\HomeExpenseCalculator\Window1.xaml 16 10 HomeExpenseCalculator – Shad Khan Sep 17 '13 at 13:38