or
<DataTemplate
x:Key="DragTemplate">
</DataTemplate>
Thoughts?
I'll add a screen shot if I figure out how to do that..
<
chart:ChartArea
Grid.Row
=
"1"
x:Name
=
"mainChartArea"
LegendName
=
"legend"
>
<
chart:ChartArea.AxisX
>
<
chart:AxisX
MajorGridLinesVisibility
=
"Collapsed"
IsDateTime
=
"True"
DefaultLabelFormat
=
"dd-MMM"
Title
=
"Date"
MinorTickPointMultiplier
=
"0"
AutoRange
=
"False"
MajorTicksVisibility
=
"Visible"
AxisLabelsVisibility
=
"Visible"
MinorTicksVisibility
=
"Hidden"
/>
</
chart:ChartArea.AxisX
>
</
chart:ChartArea
>
<
UserControl
x:Class
=
"KfzOrtung6.Modells.UserControl1"
mc:Ignorable
=
"d"
d:DesignHeight
=
"498"
d:DesignWidth
=
"924"
xmlns:my
=
"clr-namespace:KfzOrtung6DataClasses.Modells;assembly=KfzOrtung6DataClasses"
Loaded
=
"UserControl_Loaded"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
UserControl.Resources
>
<
CollectionViewSource
x:Key
=
"fahrzeugeViewSource"
d:DesignSource
=
"{d:DesignInstance my:Fahrzeuge, CreateList=True}"
/>
</
UserControl.Resources
>
<
Grid
DataContext
=
"{StaticResource fahrzeugeViewSource}"
>
<
DataGrid
AutoGenerateColumns
=
"False"
EnableRowVirtualization
=
"True"
Height
=
"88"
HorizontalAlignment
=
"Left"
ItemsSource
=
"{Binding}"
Margin
=
"32,28,0,0"
Name
=
"fahrzeugeDataGrid"
RowDetailsVisibilityMode
=
"VisibleWhenSelected"
VerticalAlignment
=
"Top"
Width
=
"654"
>
<
DataGrid.Columns
>
<
DataGridTemplateColumn
x:Name
=
"ablaufsimkarteColumn"
Header
=
"Ablaufsimkarte"
Width
=
"SizeToHeader"
>
<
DataGridTemplateColumn.CellTemplate
>
<
DataTemplate
>
<
DatePicker
SelectedDate
=
"{Binding Path=Ablaufsimkarte, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
/>
</
DataTemplate
>
</
DataGridTemplateColumn.CellTemplate
>
</
DataGridTemplateColumn
>
<
DataGridTextColumn
x:Name
=
"aktivColumn"
Binding
=
"{Binding Path=Aktiv}"
Header
=
"Aktiv"
Width
=
"SizeToHeader"
/>
<
DataGridTextColumn
x:Name
=
"bemerkungColumn"
Binding
=
"{Binding Path=Bemerkung}"
Header
=
"Bemerkung"
Width
=
"SizeToHeader"
/>
<
DataGridTextColumn
x:Name
=
"iDColumn"
Binding
=
"{Binding Path=ID}"
Header
=
"ID"
Width
=
"SizeToHeader"
/>
<
DataGridTextColumn
x:Name
=
"kennzeichenColumn"
Binding
=
"{Binding Path=Kennzeichen}"
Header
=
"Kennzeichen"
Width
=
"SizeToHeader"
/>
<
DataGridTemplateColumn
x:Name
=
"nameColumn"
Header
=
"Name"
Width
=
"SizeToHeader"
>
<
DataGridTemplateColumn.CellTemplate
>
<
DataTemplate
>
<
ComboBox
>
<
ComboBoxItem
Content
=
"{Binding Path=Name}"
/>
</
ComboBox
>
</
DataTemplate
>
</
DataGridTemplateColumn.CellTemplate
>
</
DataGridTemplateColumn
>
<
DataGridTextColumn
x:Name
=
"rufnummerColumn"
Binding
=
"{Binding Path=Rufnummer}"
Header
=
"Rufnummer"
Width
=
"SizeToHeader"
/>
</
DataGrid.Columns
>
</
DataGrid
>
<
telerik:RadGridView
x:Name
=
"mygrid"
Margin
=
"32,136,0,35"
ItemsSource
=
"{Binding}"
HorizontalAlignment
=
"Left"
Width
=
"654"
>
</
telerik:RadGridView
>
<
Button
Content
=
"Button"
Height
=
"23"
HorizontalAlignment
=
"Left"
Margin
=
"795,162,0,0"
Name
=
"button1"
VerticalAlignment
=
"Top"
Width
=
"75"
Click
=
"button1_Click"
/>
</
Grid
>
</
UserControl
>
using
System;
using
System.Collections.Generic;
using
System.Data.Entity;
using
System.Linq;
using
System.Text;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Data;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Imaging;
using
System.Windows.Navigation;
using
System.Windows.Shapes;
using
KfzOrtung6DataClasses.Modells;
namespace
KfzOrtung6.Modells
{
/// <summary>
/// Interaktionslogik für UserControl1.xaml
/// </summary>
public
partial
class
UserControl1 : UserControl
{
KfzContext6 kt =
new
KfzContext6();
public
UserControl1()
{
InitializeComponent();
}
private
void
UserControl_Loaded(
object
sender, RoutedEventArgs e)
{
kt.MFahrzeuge.Load();
var cc = kt.MFahrzeuge.Local;
// Laden Sie Ihre Daten nicht zur Entwurfszeit.
//if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
//{
// //Laden Sie hier Ihre Daten, und weisen Sie das Ergebnis der CollectionViewSource zu.
CollectionViewSource myCollectionViewSource = (CollectionViewSource)
this
.Resources[
"fahrzeugeViewSource"
];
myCollectionViewSource.Source = cc;
//}
}
private
void
button1_Click(
object
sender, RoutedEventArgs e)
{
Fahrzeuge fz =
new
Fahrzeuge
{
ID = Guid.NewGuid(),
Name =
"LKW Test 2"
,
Kennzeichen =
"Sad-Br-505"
,
Ablaufsimkarte =
new
DateTime(2000, 1, 1),
Rufnummer =
""
,
Aktiv = 1
};
kt.MFahrzeuge.Add(fz);
kt.SaveChanges();
mygrid.Items.Refresh();
}
}
}
<
Popup
x:Name
=
"PART_Popup"
Margin
=
"0,1,0,0"
>
<
Border
BorderBrush
=
"#FF595959"
BorderThickness
=
"1"
Background
=
"#FF3D3D3D"
MaxHeight
=
"{TemplateBinding MaxDropDownHeight}"
MinWidth
=
"{TemplateBinding MinDropDownWidth}"
>
<
telerik:RadGridView
x:Name
=
"RadGridView1"
ShowGroupPanel
=
"False"
CanUserFreezeColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
IsReadOnly
=
"True"
IsFilteringAllowed
=
"True"
ItemsSource
=
"{Binding Dokumente}"
MaxWidth
=
"500"
MaxHeight
=
"400"
SelectedItem
=
"{Binding SelectedItem, Mode=TwoWay}"
>
</
telerik:RadGridView
>
</
Border
>
</
Popup
>