Mini Kabibi Habibi
<local:GridDemoModule x:Class="GridDemo.TreeListView"
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;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:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
xmlns:local="clr-namespace:GridDemo"
mc:Ignorable="d" d:DesignHeight="400" d:DesignWidth="800" UseGridControlWrapperAsDataContext="True">
<local:GridDemoModule.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/GridDemo;component/ModuleResources/TreeListViewTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>
<dxdb:EmployeesWithPhotoData x:Key="employeesData" />
</ResourceDictionary>
</local:GridDemoModule.Resources>
<dxdb:DemoModuleControl>
<dxdb:DemoModuleControl.OptionsContent>
<StackPanel>
<dx:GroupFrame Header="Customization Options" Margin="0,0,0,12">
<StackPanel>
<dxe:CheckEdit x:Name="allowSortingCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.AllowSorting, Mode=TwoWay}" Content="Allow Sorting" />
<dxe:CheckEdit x:Name="allowMovingCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.AllowColumnMoving, Mode=TwoWay}" Content="Allow Moving" />
<dxe:CheckEdit x:Name="allowResizingCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.AllowResizing, Mode=TwoWay}" Content="Allow Resizing" />
<dxe:CheckEdit x:Name="showIndicatorCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.ShowIndicator, Mode=TwoWay}" Content="Show Indicator" />
<dxe:CheckEdit x:Name="autoWidthCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.AutoWidth, Mode=TwoWay}" Content="Column Auto Width" />
<dxe:CheckEdit x:Name="allowPerPixelScrollingCheckEdit" Margin="0,0,0,0" IsChecked="{Binding Path=GridControl.View.AllowPerPixelScrolling, Mode=TwoWay}" Content="Allow Per Pixel Scrolling" />
</StackPanel>
</dx:GroupFrame>
<dx:GroupFrame Header="Appearance Options" Margin="0,0,0,12">
<StackPanel>
<dxe:CheckEdit Name="showVerticalLinesCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.ShowVerticalLines, Mode=TwoWay}" Content="Show Vertical Lines" />
<dxe:CheckEdit Name="showHorizontalLinesCheckEdit" Margin="0,0,0,4" IsChecked="{Binding Path=GridControl.View.ShowHorizontalLines, Mode=TwoWay}" Content="Show Horizontal Lines" />
<dxe:CheckEdit Name="showTreelLinesCheckEdit" Margin="0,0,0,0" IsChecked="{Binding Path=GridControl.View.TreeLineStyle, Mode=TwoWay, Converter={StaticResource showTreeLinesConverter}}" Content="Show Tree Lines" />
</StackPanel>
</dx:GroupFrame>
<dx:GroupFrame Header="Navigation Style" Margin="0,0,0,12">
<dxe:ComboBoxEdit Margin="0,0,30,0" x:Name="NavigationStyleComboBox" IsTextEditable="False" SelectedItem="{Binding Path=GridControl.View.NavigationStyle, Mode=TwoWay}">
<dxe:ComboBoxEdit.ItemsSource>
<local:NavigationStyleList>
<dxg:GridViewNavigationStyle>Cell</dxg:GridViewNavigationStyle>
<dxg:GridViewNavigationStyle>Row</dxg:GridViewNavigationStyle>
</local:NavigationStyleList>
</dxe:ComboBoxEdit.ItemsSource>
</dxe:ComboBoxEdit>
</dx:GroupFrame>
<dxe:CheckEdit IsChecked="{Binding Path=GridControl.View.AllowFixedColumnMenu, Mode=TwoWay}" Content="Enable Fixed Column Menu" Margin="0,0,0,4" />
<dxe:CheckEdit Name="chkEnableContextMenu" IsChecked="True" Content="Enable Context Menus" Margin="0,0,0,4" Checked="chkEnableContextMenu_Checked" Unchecked="chkEnableContextMenu_Unchecked"/>
<dxe:CheckEdit IsChecked="{Binding Path=GridControl.View.AllowEditing, Mode=TwoWay}" Margin="0,0,0,12" Content="Enable Editing" IsEnabled="{Binding Path=SelectedItem, ElementName=NavigationStyleComboBox, Converter={StaticResource navigationStyleToIsEnabledConverter}}"/>
<ToggleButton Name="showHideButton" Height="22" IsChecked="{Binding Path=GridControl.View.IsColumnChooserVisible, Mode=TwoWay}"
Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={StaticResource ShowColumnChooserButtonContentConverter}}"/>
</StackPanel>
</dxdb:DemoModuleControl.OptionsContent>
<dxg:GridControl x:Name="treeList" ItemsSource="{Binding Path=DataSource, Source={StaticResource employeesData}}">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="JobTitle" />
<dxg:GridColumn FieldName="FullName" UnboundType="String" AllowEditing="False" UnboundExpression="[FirstName] + ' ' + [LastName]" />
<dxg:GridColumn FieldName="City" />
<dxg:GridColumn FieldName="AddressLine1" Header="Address" Visible="False"/>
<dxg:GridColumn FieldName="Phone" Visible="False"/>
<dxg:GridColumn FieldName="GroupName" MinWidth="210"/>
<dxg:GridColumn FieldName="ImageData" Width="60" FixedWidth="True" Header="Photo" AllowResizing="False" CellTemplate="{StaticResource photoTemplate}" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TreeListView x:Name="view" AllowPerPixelScrolling="True" KeyFieldName="Id" ParentFieldName="ParentId"
AutoWidth="True" ShowSearchPanelMode="Never" />
</dxg:GridControl.View>
</dxg:GridControl>
</dxdb:DemoModuleControl>
</local:GridDemoModule>