我有一个DataGrid
,我希望根据数据来确定列的类型并为这些DataGrid创建。
这意味着我看到该字段是一个日期,然后我想在DataGrid中有一个日期选择器。
Case "CURDATE"
Dim col As New DataGrid Template Column
col.Header = "Yay"
Dim fac As New FrameworkElement Factory
Dim b As Binding = New Binding ("CURDATE")
fac.SetValue (DatePicker.SelectedDateProperty b)
Dim cellil As DataTemplate = New Data Template
cellil.VisualTree = fac
col.CellEditingTemplate = cellil
Ctr.Columns.Add (col)