Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Xaml converter Error
    primarykey
    data
    text
    <p>I am getting a compilation error as </p> <blockquote> <p>Error 1 The type or namespace name 'Converters' could not be found (are you missing a using directive or an assembly reference?) G:\C#\Practice\DataGrid\DataGrid\obj\x86\Debug\MainWindow.g.cs 12 7 DataGrid</p> </blockquote> <p>Below is my Xaml code, I am new to WPF please help me out. I have the converter Class.</p> <pre><code>&lt;Window x:Class="DataGrid.MainWindow " xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="500" Width="700" xmlns:c="clr-namespace:Converters"&gt; &lt;Window.Resources&gt; &lt;c:BoolToStringConverter x:Key="BoolToStringConverter" /&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="59*" /&gt; &lt;RowDefinition Height="402*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;StackPanel Margin="0,55,0,0" Grid.RowSpan="2"&gt; &lt;DataGrid ItemsSource="{Binding Path=Courses}" AutoGenerateColumns="False" HorizontalAlignment="Left" Name="datagrid1" CanUserAddRows="False" HeadersVisibility="Column" RowDetailsVisibilityMode="Visible" VerticalScrollBarVisibility="Auto" CanUserSortColumns="True" CanUserResizeColumns="False" Height="339" Width="610"&gt; &lt;DataGrid.Resources&gt; &lt;Style TargetType="{x:Type CheckBox}" x:Key="DataGridCheckBox"&gt; &lt;Setter Property="HorizontalAlignment" Value="Center" /&gt; &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt; &lt;Setter Property="IsEnabled" Value="True" /&gt; &lt;Setter Property="Margin" Value="4" /&gt; &lt;Setter Property="VerticalAlignment" Value="Center" /&gt; &lt;Setter Property="VerticalContentAlignment" Value="Center" /&gt; &lt;/Style&gt; &lt;/DataGrid.Resources&gt; &lt;DataGrid.Columns&gt; &lt;DataGridTemplateColumn Header="Course Title" Width="100"&gt; &lt;DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel&gt; &lt;TextBlock Text="{Binding Path=Code}" VerticalAlignment="Center" /&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/DataGridTemplateColumn.CellTemplate&gt; &lt;/DataGridTemplateColumn&gt; &lt;DataGridTemplateColumn Header="Course Description" Width="*"&gt; &lt;DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel&gt; &lt;TextBlock Text="{Binding Path=Descrption}" VerticalAlignment="Center" /&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/DataGridTemplateColumn.CellTemplate&gt; &lt;/DataGridTemplateColumn&gt; &lt;DataGridTemplateColumn Header="Required" Width="100"&gt; &lt;DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{Binding Path=IsRequired, Converter={StaticResource BoolToStringConverter}}" VerticalAlignment="Center" /&gt; &lt;/DataTemplate&gt; &lt;/DataGridTemplateColumn.CellTemplate&gt; &lt;/DataGridTemplateColumn&gt; &lt;/DataGrid.Columns&gt; &lt;/DataGrid&gt; &lt;/StackPanel&gt; &lt;StackPanel Margin="0,0,539,32"&gt; &lt;TextBlock Text="Select Enroolment:" FontSize="15" Height="26" Grid.RowSpan="1" Width="134"&gt; &lt;/TextBlock&gt; &lt;/StackPanel&gt; &lt;TextBlock DockPanel.Dock="Left" HorizontalAlignment="Left" Text="Select Course:" Width="139" FontSize="15" Margin="0,32,0,0"&gt; &lt;/TextBlock&gt; &lt;ComboBox HorizontalAlignment="Right" Margin="0,0,69,33" Name="comboBox1" Width="476" Height="23" VerticalAlignment="Bottom" /&gt; &lt;/Grid&gt; </code></pre> <p> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload