or
<telerik:RadGridView Grid.Row="1" x:Name="radGridView" telerik:Theming.Theme="Expression_Dark" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AutoGenerateColumns="False" IsReadOnly="True" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" Margin="0,0,0,27" ShowGroupPanel="False"><telerik:RadGridView.Columns> <telerik:GridViewToggleRowDetailsColumn /> <telerik:GridViewDataColumn DataMemberBinding="{Binding No}" Header="No."/> <telerik:GridViewDataColumn DataMemberBinding="{Binding Adm_Date}" Header="Date Admission" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" /></telerik:RadGridView.Columns></telerik:RadGridView>this.radGridView.AddHandler(GridViewCell.MouseLeftButtonDownEvent, new MouseButtonEventHandler(MouseDownOnCell), true);private void MouseDownOnCell(object sender, MouseButtonEventArgs e){ try { object cellValue = ((UIElement)e.OriginalSource).ParentOfType<GridViewCell>().Value; MessageBox.Show("Click on : " + cellValue.ToString()); } catch (Exception ex) { MessageBox.Show(ex.Message); return; }}<scheduleView:OrientedGroupHeaderContentTemplateSelector x:Key="GroupHeaderContentTemplateSelector"> <!-- Default templates: --> <scheduleView:OrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate> <DataTemplate> <Border Background="#959595" Width="310" Margin="0 0 0 0"> <StackPanel Margin="5 5 5 5" Orientation="Horizontal"> <TextBlock Foreground="Black" FontSize="12" FontWeight="Normal" Text="{Binding Name.Group}" HorizontalAlignment="Left" Width="150"/> <TextBlock Foreground="Black" FontSize="12" FontWeight="Normal" Text="|" HorizontalAlignment="Center" Width="10"/> <TextBlock Foreground="Black" FontSize="12" FontWeight="Normal" Text="{Binding Name.Name}" HorizontalAlignment="Left" Width="150"/> </StackPanel> </Border> </DataTemplate> </scheduleView:OrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate> <scheduleView:OrientedGroupHeaderContentTemplateSelector.HorizontalResourceTemplate> <DataTemplate> <Border Background="#959595" Width="310" Margin="0 0 0 0"> <StackPanel Margin="5 5 5 5" Orientation="Horizontal"> <TextBlock Foreground="Black" FontSize="12" FontWeight="Normal" Text="{Binding Name.Group}" HorizontalAlignment="Left" Width="150"/> <TextBlock Foreground="Black" FontSize="12" FontWeight="Normal" Text="|" HorizontalAlignment="Center" Width="10"/> <TextBlock Foreground="Black" FontSize="12" FontWeight="Normal" Text="{Binding Name.Name}" HorizontalAlignment="Left" Width="150"/> </StackPanel> </Border> </DataTemplate> </scheduleView:OrientedGroupHeaderContentTemplateSelector.HorizontalResourceTemplate> </scheduleView:OrientedGroupHeaderContentTemplateSelector><scheduleView:RadScheduleView x:Name="SchedulerMonat" ActiveViewDefinitionIndex="0" AppointmentsSource="{Binding Appointments}" ResourceTypesSource="{Binding ResourcesTypes}" GroupDescriptionsSource="{Binding GroupDescirptionSource}" GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}" SpecialSlotsSource="{Binding SpecialSlots}" SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}" ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}" AppointmentCreating="SchedulerMonat_AppointmentCreating" AppointmentEditing="SchedulerMonat_AppointmentEditing" ShowDialog="SchedulerMonat_ShowDialog" VisibleRangeChanged="SchedulerMonat_VisibleRangeChanged" Margin="0,103,0,0" VisibleRangeChangedCommand="{Binding VisibleRangeChanged}" VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}" AppointmentEdited="SchedulerMonat_AppointmentEdited" SnapAppointments="True" > <scheduleView:RadScheduleView.AppointmentStyleSelector> <monatsmatrixWPF_extension:AppointmentStyleSelector Level200HorizontalStyle="{StaticResource Level200HorizontalStyle}" Level200HorizontalStyleCrossed="{StaticResource Level200HorizontalStyleCrossed}" Level200HorizontalStyleLeft="{StaticResource Level200HorizontalStyleLeft}" Level200HorizontalStyleRight="{StaticResource Level200HorizontalStyleRight}" HorizontalStyle="{StaticResource Level200HorizontalStyle}" /> </scheduleView:RadScheduleView.AppointmentStyleSelector> <scheduleView:RadScheduleView.ViewDefinitions> <scheduleView:TimelineViewDefinition VisibleDays="30" TimerulerGroupStringFormat="{}{0:dd ddd}" TimerulerMajorTickStringFormat="" Title="Monatsansicht - " LargeChangeInterval="31d"/> </scheduleView:RadScheduleView.ViewDefinitions> <telerik:RadContextMenu.ContextMenu> <telerik:RadContextMenu Name="ContextMenu" IsOpen="{Binding IsContextMenuOpen, Source={StaticResource ContextMenueDataModel},Mode=TwoWay}" ScrollViewer.CanContentScroll="True"> <telerik:RadMenuItem Name="ContextMenuNew" Header="Neuer Termin" Command="{Binding NewCommand, Source={StaticResource ContextMenueDataModel}}" CommandParameter="{Binding Menu.UIElement.SelectedSlot, RelativeSource={RelativeSource Self}}" Click="FabaContextMenue_Click"> <telerik:RadMenuItem.Icon> <Image Source="/monatsmatrixWPF;component/img/Neu.png"></Image> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> <telerik:RadMenuItem IsSeparator="True" /> <telerik:RadMenuItem Name="ContextMenuRead" Header="Termin lesen" Command="{Binding ReadCommand, Source={StaticResource ContextMenueDataModel}}" CommandParameter="{Binding Menu.UIElement.SelectedAppointments, RelativeSource={RelativeSource Self}}" Click="FabaContextMenue_Click"> <telerik:RadMenuItem.Icon> <Image Source="/monatsmatrixWPF;component/img/Lesen.png"></Image> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> <telerik:RadMenuItem Name="ContextMenuEdit" Header="Termin bearbeiten" Command="{Binding EditCommand, Source={StaticResource ContextMenueDataModel}}" CommandParameter="{Binding Menu.UIElement.SelectedAppointments, RelativeSource={RelativeSource Self}}" Click="FabaContextMenue_Click"> <telerik:RadMenuItem.Icon> <Image Source="/monatsmatrixWPF;component/img/bearbeiten.png"></Image> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> <telerik:RadMenuItem Name="ContextMenuDelete" Header="Termin löschen" Command="{Binding DeleteCommand, Source={StaticResource ContextMenueDataModel}}" CommandParameter="{Binding Menu.UIElement.SelectedAppointments, RelativeSource={RelativeSource Self}}" Click="FabaContextMenue_Click"> <telerik:RadMenuItem.Icon> <Image Source="/monatsmatrixWPF;component/img/loeschen.png"></Image> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> <telerik:RadMenuItem IsSeparator="True" /> <telerik:RadMenuItem Name="Group1" Header="Guppe 1"> </telerik:RadMenuItem> <telerik:RadMenuItem Name="Group2" Header="Guppe 2"> </telerik:RadMenuItem> <telerik:RadMenuItem Name="Group3" Header="Guppe 3"> </telerik:RadMenuItem> </telerik:RadContextMenu> </telerik:RadContextMenu.ContextMenu> </scheduleView:RadScheduleView><Window x:Class="WpfApplication1.GridWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="GridWindow" Height="300" Width="600"> <Grid> <telerik:RadGridView EnableColumnVirtualization="False"> <telerik:RadGridView.Columns> <telerik:GridViewColumn Header="Column 1" /> <telerik:GridViewColumn Header="Column 2" /> <telerik:GridViewColumn Header="Column 3" /> <telerik:GridViewColumn Header="Column 4" /> <telerik:GridViewColumn Header="Column 5" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid> </Window>2012-01-09 10:09:18,868 FATAL - User Interface : Unhandled ExceptionSystem.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld. bij System.Windows.Automation.Peers.AutomationPeer.EnsureChildren() bij System.Windows.Automation.Peers.AutomationPeer.UpdateChildren() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() bij System.Windows.ContextLayoutManager.fireAutomationEvents() bij System.Windows.ContextLayoutManager.UpdateLayout() bij System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) bij System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() bij System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() bij System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) bij System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)<UserControl x:Class="BrabantWater.UI.Screens.ZInspectionListScreen" xmlns:imageFactory="clr-namespace:Sap.Eam.UI.Theme;assembly=CustomTheme_WPF" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Height="auto" Width="auto"> <UserControl.Resources> <BooleanToVisibilityConverter x:Key="boolToVisConverter"/> <DataTemplate x:Key="StatusButtons"> <StackPanel Orientation="Horizontal" Width="110"> <telerik:RadButton Click="RadButtonDelete_Click" MinWidth="50" IsEnabled="{Binding Path=IsDeletable, Mode=OneWay}"> <Image Source="{Binding Path=DeleteImage, Mode=OneWay}" Width="32"/> </telerik:RadButton> <telerik:RadButton Click="RadButtonStatus_Click" MinWidth="50" IsEnabled="{Binding Path=IsEditable,Mode=OneWay}"> <Image Source="{Binding Path=StatusImage, Mode=OneWay}" Width="32"/> </telerik:RadButton> </StackPanel> </DataTemplate> </UserControl.Resources> <Grid x:Name="GridContainer"> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5,5,5,5" Height="35" HorizontalAlignment="Stretch" VerticalAlignment="Center"> <telerik:RadButton x:Name="ButtonNewInstallation" Content="{lex:LocText Key=Inspection_New_Installation, Dict=InspectionResources, Assembly=Win32Resources}" MinWidth="100" Click="ButtonNewInstallation_Click"/> <telerik:RadButton x:Name="ButtonNewDamage" Content="{lex:LocText Key=Inspection_New_Defect, Dict=InspectionResources, Assembly=Win32Resources}" Margin="10,0,0,0" MinWidth="100" Click="ButtonNewDamage_Click"/> </StackPanel> <telerik:RadGridView x:Name="InspectionGrid" AlternationCount="2" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" ColumnWidth="*" EditTriggers="None" Grid.Row="1" Margin="5" MouseDoubleClick="InspectionGrid_MouseDoubleClick" RowIndicatorVisibility="Collapsed" SelectionChanged="InspectionGrid_SelectionChanged" SelectedItem="{Binding Path=CurrentInspection, Mode=TwoWay}" ShowGroupPanel="false"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn UniqueName="DamageCodeDescription" Header="{lex:LocText Key=Inspection_Space, Dict=InspectionResources, Assembly=Win32Resources}" DataMemberBinding="{Binding Path=DamageCodeDescription, Mode=OneWay}"/> <telerik:GridViewDataColumn UniqueName="ItemCodeDescription" Header="{lex:LocText Key=Inspection_Part, Dict=InspectionResources, Assembly=Win32Resources}" DataMemberBinding="{Binding Path=ItemCodeDescription, Mode=OneWay}"/> <telerik:GridViewDataColumn UniqueName="ItemDescription" Header="{lex:LocText Key=Inspection_Addition, Dict=InspectionResources, Assembly=Win32Resources}" DataMemberBinding="{Binding Path=ItemDescription, Mode=OneWay}"/> <telerik:GridViewDataColumn UniqueName="CauseCodeDescription" Header="{lex:LocText Key=Inspection_Task, Dict=InspectionResources, Assembly=Win32Resources}" DataMemberBinding="{Binding Path=CauseCodeDescription, Mode=OneWay}" /> <telerik:GridViewDataColumn UniqueName="TaskCodeDescription" Header="{lex:LocText Key=Inspection_Finding, Dict=InspectionResources, Assembly=Win32Resources}" DataMemberBinding="{Binding Path=TaskCodeDescription, Mode=OneWay}" /> <telerik:GridViewDataColumn UniqueName="ActivityCodeDescription" Header="{lex:LocText Key=Inspection_Risk, Dict=InspectionResources, Assembly=Win32Resources}" DataMemberBinding="{Binding Path=ActivityCodeDescription, Mode=OneWay}" /> <telerik:GridViewImageColumn DataMemberBinding="{Binding Path=AttachmentImage, Mode=OneWay}" Header="{lex:LocText Key=Inspection_Attachments, Dict=InspectionResources, Assembly=Win32Resources}" ImageHeight="32" ImageWidth="32" IsFilterable="False" MaxWidth="60" MinWidth="60" /> <telerik:GridViewColumn CellTemplate="{StaticResource StatusButtons}" IsFilterable="False" MaxWidth="120" MinWidth="120" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid></UserControl> The version of the Telerik WPF components being used: 2010.2.0716.35.