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
>