Mini Kabibi Habibi
<local:TreeListDemoModule x:Class="TreeListDemo.UnboundMode"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:collections="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:global="clr-namespace:System.Globalization;assembly=mscorlib"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
xmlns:local="clr-namespace:TreeListDemo"
mc:Ignorable="d" d:DesignHeight="400" d:DesignWidth="800">
<dxdb:DemoModuleControl>
<dxdb:DemoModuleControl.Resources>
<local:SummaryIconVisibilityConverter x:Key="summaryIconVisibilityConverter" />
<DataTemplate x:Key="summTemplate">
<dx:MeasurePixelSnapper SnapperType="Around">
<Image Source="/TreeListDemo;component/Images/Summary.png" Width="12" Height="12"
Visibility="{Binding RowData.Row, Converter={StaticResource summaryIconVisibilityConverter}}"/>
</dx:MeasurePixelSnapper>
</DataTemplate>
<dxdb:EmployeesData x:Key="EmployeesData" />
<DataTemplate x:Key="DateTemplate">
<Grid >
<dxe:DateEdit x:Name="PART_Editor" AllowNullInput="True" />
<ContentControl Content="{Binding}" HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center"
ContentTemplate="{StaticResource summTemplate}" />
</Grid>
</DataTemplate>
<local:States x:Key="StateData" />
<BitmapImage UriSource="/TreeListDemo;component/Images/Object_Project.png" x:Key="ProjectImage" />
<ControlTemplate x:Key="ComboBoxPersonItemTemplate">
<StackPanel Orientation="Horizontal" Margin="3,0,0,0" Background="Transparent">
<dx:PixelSnapper>
<Image Height="16" Width="16" Source="{Binding Path=(dxe:BaseEdit.OwnerEdit).SelectedItem.Image}" />
</dx:PixelSnapper>
<TextBlock Margin="2" Text="{Binding Path=(dxe:BaseEdit.OwnerEdit).SelectedItem}" VerticalAlignment="Center" />
</StackPanel>
</ControlTemplate>
<DataTemplate x:Key="ComboBoxPersonEdit">
<dxe:ComboBoxEdit Name="PART_Editor" ItemsSource="{Binding Path=DataSource, Source={StaticResource EmployeesData}}"
IsTextEditable="False" DisplayTemplate="{StaticResource ComboBoxPersonItemTemplate}"
EditNonEditableTemplate="{StaticResource ComboBoxPersonItemTemplate}">
<dxe:ComboBoxEdit.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<dx:MeasurePixelSnapper>
<Image Height="16" Width="16" Source="{Binding Image}" />
</dx:MeasurePixelSnapper>
<TextBlock Text="{Binding BindsDirectlyToSource=True}" Margin="2" />
</StackPanel>
</DataTemplate>
</dxe:ComboBoxEdit.ItemTemplate>
</dxe:ComboBoxEdit>
</DataTemplate>
<ControlTemplate x:Key="ComboBoxStateItemTemplate">
<StackPanel Orientation="Horizontal" Margin="3,0,0,0" Background="Transparent">
<dx:PixelSnapper>
<Image Height="16" Width="16" Source="{Binding Path=(dxe:BaseEdit.OwnerEdit).SelectedItem.Image}" />
</dx:PixelSnapper>
<TextBlock Margin="2" Text="{Binding Path=(dxe:BaseEdit.OwnerEdit).SelectedItem.TextValue}" VerticalAlignment="Center" />
</StackPanel>
</ControlTemplate>
<DataTemplate x:Key="ComboBoxStateEdit">
<Grid>
<dxe:ComboBoxEdit Name="PART_Editor" ItemsSource="{Binding Path=DataSource, Source={StaticResource StateData}}"
IsTextEditable="False" DisplayTemplate="{StaticResource ComboBoxStateItemTemplate}"
EditNonEditableTemplate="{StaticResource ComboBoxStateItemTemplate}" >
<dxe:ComboBoxEdit.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<dx:MeasurePixelSnapper SnapperType="Around">
<Image Height="16" Width="16" Source="{Binding Image}" />
</dx:MeasurePixelSnapper>
<TextBlock Text="{Binding TextValue}" Margin="2" />
</StackPanel>
</DataTemplate>
</dxe:ComboBoxEdit.ItemTemplate>
</dxe:ComboBoxEdit>
<ContentControl Content="{Binding}" HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center"
ContentTemplate="{StaticResource summTemplate}" />
</Grid>
</DataTemplate>
</dxdb:DemoModuleControl.Resources>
<dxg:TreeListControl x:Name="treeList">
<dxg:TreeListControl.Columns>
<dxg:TreeListColumn FieldName="NameValue" Header="Name" AllowSorting="True" />
<dxg:TreeListColumn FieldName="Executor" CellTemplate="{StaticResource ComboBoxPersonEdit}" AllowSorting="True" />
<dxg:TreeListColumn FieldName="StartDate" UnboundType="DateTime" Header="Start date" CellTemplate="{StaticResource DateTemplate}" />
<dxg:TreeListColumn FieldName="EndDate" UnboundType="DateTime" Header="End date" CellTemplate="{StaticResource DateTemplate}"/>
<dxg:TreeListColumn FieldName="State" UnboundType="Object" CellTemplate="{StaticResource ComboBoxStateEdit}" ColumnFilterMode="DisplayText" AllowSorting="True" />
</dxg:TreeListControl.Columns>
<dxg:TreeListControl.View>
<dxg:TreeListView x:Name="view" AutoWidth="True" CustomUnboundColumnData="GetColumnData" ShowingEditor="EditorVisibility" ShowNodeImages="True" CellValueChanging="CellValueChanging" >
<dxg:TreeListView.Nodes>
<dxg:TreeListNode Image="{StaticResource ProjectImage}">
<dxg:TreeListNode.Content>
<local:ProjectObject NameValue="Project: Stantone" />
</dxg:TreeListNode.Content>
</dxg:TreeListNode>
<dxg:TreeListNode Image="{StaticResource ProjectImage}">
<dxg:TreeListNode.Content>
<local:ProjectObject NameValue="Project: Betaron" />
</dxg:TreeListNode.Content>
</dxg:TreeListNode>
</dxg:TreeListView.Nodes>
</dxg:TreeListView>
</dxg:TreeListControl.View>
</dxg:TreeListControl>
</dxdb:DemoModuleControl>
</local:TreeListDemoModule>