1
+ <ContentPage xmlns =" http://schemas.microsoft.com/dotnet/2021/maui"
2
+ xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
3
+ xmlns : dxcv =" clr-namespace:DevExpress.Maui.CollectionView;assembly=DevExpress.Maui.CollectionView"
4
+ xmlns : ios =" clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
5
+ xmlns : dxg =" clr-namespace:DevExpress.Maui.DataGrid;assembly=DevExpress.Maui.DataGrid"
6
+ xmlns : dxc =" clr-namespace:DevExpress.Maui.Controls;assembly=DevExpress.Maui.Controls"
7
+ xmlns : local =" clr-namespace:DataGridDragDrop"
8
+ ios:Page.UseSafeArea=" true"
9
+ x : Class = " DataGridDragDrop.MainPage" >
10
+ <ContentPage .Resources>
11
+ <local : ImportanceToColorConverter x : Key =" importanceToColorConverter" />
12
+ </ContentPage .Resources>
13
+ <dxg : DataGridView ItemsSource =" {Binding Tasks}" IsColumnHeaderVisible =" False" SelectionMode =" None" BackgroundColor =" {AppThemeBinding Light={StaticResource Gray50}, Dark=#141414}"
14
+ AllowDragDropRows =" True" AllowDragDropSortedRows =" True" AllowGroupCollapse =" False"
15
+ CustomSort =" DataGridView_CustomSort" CustomGroup =" DataGridView_CustomGroup"
16
+ CompleteRowDragDrop =" DataGridView_CompleteRowDragDrop"
17
+ DragRow =" DataGridView_DragRow" x : Name =" dataGrid" >
18
+ <dxg : DataGridView .GroupRowAppearance>
19
+ <dxg : GroupRowAppearance HorizontalLineThickness =" 0" BackgroundColor =" {AppThemeBinding Light=#F1F1F1, Dark=#141414}" />
20
+ </dxg : DataGridView .GroupRowAppearance>
21
+ <dxg : DataGridView .CellAppearance>
22
+ <dxg : CellAppearance BackgroundColor =" {AppThemeBinding Light={StaticResource Gray50}, Dark=#141414}" HorizontalLineThickness =" 0" />
23
+ </dxg : DataGridView .CellAppearance>
24
+ <dxg : DataGridView .GroupRowTemplate>
25
+ <DataTemplate >
26
+ <Label Text =" {Binding Value}" Margin =" 20,15,0,0" FontSize =" 14" TextColor =" {AppThemeBinding Light={StaticResource Gray500}, Dark={StaticResource Gray300}}" FontAttributes =" Bold" />
27
+ </DataTemplate >
28
+ </dxg : DataGridView .GroupRowTemplate>
29
+ <dxg : TextColumn FieldName =" Stage" IsGrouped =" True" SortMode =" Custom" />
30
+ <dxg : TemplateColumn FieldName =" Title" >
31
+ <dxg : TemplateColumn .DisplayTemplate>
32
+ <DataTemplate >
33
+ <Grid >
34
+ <Border IsVisible =" False" StrokeShape =" RoundRectangle 8,8,8,8" BackgroundColor =" {AppThemeBinding Light=White, Dark={StaticResource Gray900}}" Margin =" 10,5,10,5" StrokeThickness =" 0" >
35
+ <Grid RowDefinitions =" Auto,Auto, Auto" ColumnDefinitions =" *,Auto" >
36
+ <Border StrokeShape =" RoundRectangle 6,6,6,6" BackgroundColor =" {Binding Item.Priority, Converter={StaticResource importanceToColorConverter}}" HeightRequest =" 8" WidthRequest =" 60" Margin =" 10,4,10,0" HorizontalOptions =" Start" />
37
+ <dxc : SimpleButton Icon =" verticaldots" BackgroundColor =" {AppThemeBinding Light=White, Dark={StaticResource Gray900}}" IconColor =" {StaticResource Gray300}" Clicked =" SimpleButton_Clicked" Padding =" 0,10,0,0" WidthRequest =" 30" VerticalOptions =" End" Grid.Column=" 1" />
38
+ <Label Text =" {Binding Item.Title}" TextColor =" {AppThemeBinding Light={StaticResource Gray600}, Dark={StaticResource Gray200}}" FontSize =" 14" Margin =" 10,0,10,0" Grid.Row=" 1" />
39
+ <Border StrokeShape =" RoundRectangle 5,5,5,5" BackgroundColor =" {AppThemeBinding Light=#eceff1, Dark=#919191}}" HorizontalOptions =" Start" VerticalOptions =" End" Margin =" 10,14,10,14" Grid.Row=" 2" >
40
+ <Label FontSize =" 12" Text =" {Binding Item.DueDate, StringFormat='🕒 {0:m}'}" Margin =" 6,0,10,0" HeightRequest =" 22" VerticalTextAlignment =" Center" VerticalOptions =" Center" />
41
+ </Border >
42
+ <Image Source =" {Binding Item.AssigneePhotoPath}" WidthRequest =" 32" HeightRequest =" 32" Grid.Column=" 1" Grid.Row=" 2" Margin =" 18,6,20,10" VerticalOptions =" Start" >
43
+ <Image .Clip>
44
+ <EllipseGeometry RadiusX =" 16" RadiusY =" 16" Center =" 16,16" />
45
+ </Image .Clip>
46
+ </Image >
47
+ </Grid >
48
+ <Border .Triggers>
49
+ <DataTrigger Binding =" {Binding Item.IsPlaceholder}" Value =" False" TargetType =" Border" >
50
+ <Setter Property =" IsVisible" Value =" True" />
51
+ </DataTrigger >
52
+ </Border .Triggers>
53
+ </Border >
54
+ <Border IsVisible =" False" BackgroundColor =" Transparent" >
55
+ <Label Text =" Drag Items here" Margin =" 10,20,10,20" HorizontalOptions =" Center" />
56
+ <Border .Triggers>
57
+ <DataTrigger Binding =" {Binding Item.IsPlaceholder}" Value =" True" TargetType =" Border" >
58
+ <Setter Property =" IsVisible" Value =" True" />
59
+ </DataTrigger >
60
+ </Border .Triggers>
61
+ </Border >
62
+ </Grid >
63
+ </DataTemplate >
64
+ </dxg : TemplateColumn .DisplayTemplate>
65
+ </dxg : TemplateColumn >
66
+ </dxg : DataGridView >
67
+ </ContentPage >
0 commit comments