Skip to content

Commit a3eef6d

Browse files
Merge pull request #3926 from syncfusion-content/datagrid_features
Addressed DataGrid Staging Review Changes.
2 parents 34fc682 + 050d849 commit a3eef6d

File tree

2 files changed

+78
-64
lines changed

2 files changed

+78
-64
lines changed

MAUI/DataGrid/columns.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -383,46 +383,36 @@ this.dataGrid.Columns.RemoveAt(1);
383383
{% endhighlight %}
384384
{% endtabs %}
385385

386-
##Column Chooser
386+
## Column Chooser
387387

388388
SfDataGrid allows you show or hide columns at runtime by selecting or deselecting them through the Column Chooser. You can enable this feature by setting the `SfDataGrid.ShowColumnChooser` property.
389389

390390
{% tabs %}
391391
{% highlight xaml %}
392-
393-
<syncfusion:SfDataGrid x:Name="dataGrid"
394-
ItemsSource="{Binding OrdersInfo}"
395-
ShowColumnChooser="True">
396-
</syncfusion:SfDataGrid>
397-
392+
<syncfusion:SfDataGrid x:Name="dataGrid"
393+
ItemsSource="{Binding OrdersInfo}"
394+
ShowColumnChooser="True">
395+
</syncfusion:SfDataGrid>
398396
{% endhighlight %}
399-
400397
{% highlight c# %}
401-
402398
dataGrid.ShowColumnChooser = true;
403-
404399
{% endhighlight %}
405400
{% endtabs %}
406401

407-
###Column Chooser Header Text
402+
### Column Chooser Header Text
408403

409404
You can also customize the header text of the Column Chooser using the `SfDataGrid.ColumnChooserHeaderText` property. By default, `SfDataGrid.ColumnChooserHeaderText` property is set to `string.Empty`, so the header is not displayed. If you assign any non-empty string, the header becomes visible.
410405

411406
{% tabs %}
412407
{% highlight xaml %}
413-
414-
<syncfusion:SfDataGrid x:Name="dataGrid"
415-
ItemsSource="{Binding OrdersInfo}"
416-
ColumnChooserHeaderText="Select Visible Columns"
417-
ShowColumnChooser="True">
418-
</syncfusion:SfDataGrid>
419-
408+
<syncfusion:SfDataGrid x:Name="dataGrid"
409+
ItemsSource="{Binding OrdersInfo}"
410+
ColumnChooserHeaderText="Select Visible Columns"
411+
ShowColumnChooser="True">
412+
</syncfusion:SfDataGrid>
420413
{% endhighlight %}
421-
422414
{% highlight c# %}
423-
424415
dataGrid.ColumnChooserHeaderText = "Select Visible Columns";
425-
426416
{% endhighlight %}
427417
{% endtabs %}
428418

MAUI/DataGrid/grouping.md

Lines changed: 67 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ You can enable data grouping in the SfDataGrid by setting the `SfDataGrid.AllowG
2626
{% highlight xaml %}
2727
<syncfusion:SfDataGrid x:Name="dataGrid"
2828
ItemsSource="{Binding OrderInfoCollection}"
29-
AllowGrouping="true">
29+
AllowGrouping="True">
3030
</syncfusion:SfDataGrid>
3131
{% endhighlight %}
3232
{% highlight c# %}
33-
dataGrid.AllowGrouping = true;
33+
dataGrid.AllowGrouping = true;
3434
{% endhighlight %}
3535
{% endtabs %}
3636

@@ -53,12 +53,12 @@ You can modify the GroupDropArea text by setting the `SfDataGrid.GroupDropAreaTe
5353
<syncfusion:SfDataGrid x:Name="dataGrid"
5454
ItemsSource="{Binding OrderInfoCollection}"
5555
GroupDropAreaText="Drag and drop the column here"
56-
AllowGrouping="true">
56+
AllowGrouping="True">
5757
</syncfusion:SfDataGrid>
5858
{% endhighlight %}
5959
{% highlight c# %}
60-
dataGrid.AllowGrouping = true;
61-
dataGrid.GroupDropAreaText = "Drag and drop the column here";
60+
dataGrid.AllowGrouping = true;
61+
dataGrid.GroupDropAreaText = "Drag and drop the column here";
6262
{% endhighlight %}
6363
{% endtabs %}
6464

@@ -73,12 +73,12 @@ Use the `SfDataGrid.GroupDropAreaHeight` property to control the vertical size o
7373
<syncfusion:SfDataGrid x:Name="dataGrid"
7474
ItemsSource="{Binding OrderInfoCollection}"
7575
GroupDropAreaHeight="100"
76-
AllowGrouping="true">
76+
AllowGrouping="True">
7777
</syncfusion:SfDataGrid>
7878
{% endhighlight %}
7979
{% highlight c# %}
80-
dataGrid.AllowGrouping = true;
81-
dataGrid.GroupDropAreaHeight = 100;
80+
dataGrid.AllowGrouping = true;
81+
dataGrid.GroupDropAreaHeight = 100;
8282
{% endhighlight %}
8383
{% endtabs %}
8484

@@ -88,20 +88,19 @@ Use the `SfDataGrid.GroupDropAreaHeight` property to control the vertical size o
8888

8989
You can style the `GroupDropArea` using the following SfDataGrid properties:
9090

91-
* GroupDropAreaStrokeThickness: Sets the border thickness of the GroupDropArea.
92-
* GroupDropAreaStroke: Sets the border color of the GroupDropArea.
93-
* GroupDropAreaBackgroundColor: Sets the background color of the GroupDropArea.
94-
* GroupDropAreaTextColor: Sets the color of the instructional text displayed in the GroupDropArea.
95-
* GroupDropAreaFontSize: Sets the font size of the GroupDropArea text.
96-
* GroupDropAreaFontFamily: Sets the font family used for the GroupDropArea text.
97-
* GroupDropAreaFontAttribute: Sets the font style of the GroupDropArea text.
91+
* `GroupDropAreaStrokeThickness:` Sets the border thickness of the GroupDropArea.
92+
* `GroupDropAreaStroke:` Sets the border color of the GroupDropArea.
93+
* `GroupDropAreaBackgroundColor:` Sets the background color of the GroupDropArea.
94+
* `GroupDropAreaTextColor:` Sets the color of the instructional text displayed in the GroupDropArea.
95+
* `GroupDropAreaFontSize:` Sets the font size of the GroupDropArea text.
96+
* `GroupDropAreaFontFamily:` Sets the font family used for the GroupDropArea text.
97+
* `GroupDropAreaFontAttribute:` Sets the font style of the GroupDropArea text.
9898

9999
{% tabs %}
100100
{% highlight xaml %}
101-
102101
<syncfusion:SfDataGrid x:Name="dataGrid"
103102
ItemsSource="{Binding OrderInfoCollection}"
104-
AllowGrouping="true">
103+
AllowGrouping="True">
105104
<syncfusion:SfDataGrid.DefaultStyle>
106105
<syncfusion:DataGridStyle GroupDropAreaTextColor="Blue"
107106
GroupDropAreaBackgroundColor="Yellow"
@@ -112,29 +111,42 @@ You can style the `GroupDropArea` using the following SfDataGrid properties:
112111
GroupDropAreaFontFamily="Roboto"/>
113112
</syncfusion:SfDataGrid.DefaultStyle>
114113
</syncfusion:SfDataGrid>
114+
{% endhighlight %}
115+
{% highlight c# %}
116+
dataGrid.AllowGrouping = true;
117+
var defaultStyle = new DataGridStyle()
118+
{
119+
GroupDropAreaTextColor = Colors.Blue,
120+
GroupDropAreaBackgroundColor = Colors.Yellow,
121+
GroupDropAreaFontAttribute = FontAttributes.Bold,
122+
GroupDropAreaFontSize = 18,
123+
GroupDropAreaStroke = Colors.Brown,
124+
GroupDropAreaStrokeThickness = 2,
125+
GroupDropAreaFontFamily = "Roboto"
126+
};
115127

128+
dataGrid.DefaultStyle = defaultStyle;
116129
{% endhighlight %}
117130
{% endtabs %}
118131

119132
#### Customize the GroupDropAreaItem
120133

121134
You can style the `GroupDropAreaItem` using the following SfDataGrid properties:
122135

123-
* GroupDropItemBackgroundColor: Sets the background color of the GroupDropItem.
124-
* GroupDropItemTextColor: Sets the color of the text displayed in the GroupDropItem.
125-
* GroupDropItemFontSize: Sets the font size of the GroupDropItem text.
126-
* GroupDropItemFontFamily: Sets the font family used for the GroupDropItem text.
127-
* GroupDropItemFontAttribute: Sets the font style of the GroupDropItem text.
128-
* GroupDropItemStrokeThickness: Sets the border thickness of the GroupDropItem.
129-
* GroupDropItemStroke: Sets the border color of the GroupDropItem.
130-
* GroupDropItemCloseIconColor: Sets the color of the close icon displayed in the GroupDropItem.
136+
* `GroupDropItemBackgroundColor:` Sets the background color of the GroupDropItem.
137+
* `GroupDropItemTextColor:` Sets the color of the text displayed in the GroupDropItem.
138+
* `GroupDropItemFontSize:` Sets the font size of the GroupDropItem text.
139+
* `GroupDropItemFontFamily:` Sets the font family used for the GroupDropItem text.
140+
* `GroupDropItemFontAttribute:` Sets the font style of the GroupDropItem text.
141+
* `GroupDropItemStrokeThickness:` Sets the border thickness of the GroupDropItem.
142+
* `GroupDropItemStroke:` Sets the border color of the GroupDropItem.
143+
* `GroupDropItemCloseIconColor:` Sets the color of the close icon displayed in the GroupDropItem.
131144

132145
{% tabs %}
133146
{% highlight xaml %}
134-
135147
<syncfusion:SfDataGrid x:Name="dataGrid"
136148
ItemsSource="{Binding OrderInfoCollection}"
137-
AllowGrouping="true">
149+
AllowGrouping="True">
138150
<syncfusion:SfDataGrid.DefaultStyle>
139151
<syncfusion:DataGridStyle GroupDropItemTextColor="Blue"
140152
GroupDropItemBackgroundColor="Yellow"
@@ -146,7 +158,22 @@ You can style the `GroupDropAreaItem` using the following SfDataGrid properties:
146158
GroupDropItemCloseIconColor="Gray"/>
147159
</syncfusion:SfDataGrid.DefaultStyle>
148160
</syncfusion:SfDataGrid>
149-
161+
{% endhighlight %}
162+
{% highlight c# %}
163+
dataGrid.AllowGrouping = true;
164+
var defaultStyle = new DataGridStyle()
165+
{
166+
GroupDropItemTextColor = Colors.Blue,
167+
GroupDropItemBackgroundColor = Colors.Yellow,
168+
GroupDropItemFontAttribute = FontAttributes.Bold,
169+
GroupDropItemFontSize = 18,
170+
GroupDropItemStroke = Colors.Brown,
171+
GroupDropItemStrokeThickness = 2,
172+
GroupDropItemFontFamily = "Roboto",
173+
GroupDropItemCloseIconColor = Colors.Gray
174+
};
175+
176+
dataGrid.DefaultStyle = defaultStyle;
150177
{% endhighlight %}
151178
{% endtabs %}
152179

@@ -624,18 +651,18 @@ The following code snippet shows how to apply a background color to the indent c
624651

625652
{% tabs %}
626653
{% highlight xaml %}
627-
<ContentPage.Resources>
628-
<ResourceDictionary>
629-
<local:CellStyleConverter x:Key="cellStyleConverter" />
630-
<Style TargetType="syncfusion:DataGridIndentCell">
631-
<Setter Property="Background"
632-
Value="{Binding Source={RelativeSource Mode=Self},
633-
Converter={StaticResource
634-
Key=cellStyleConverter}}" />
635-
</Style>
636-
</ResourceDictionary>
637-
</ContentPage.Resources>
638-
<syncfusion:SfDataGrid x:Name="dataGrid"
654+
<ContentPage.Resources>
655+
<ResourceDictionary>
656+
<local:CellStyleConverter x:Key="cellStyleConverter" />
657+
<Style TargetType="syncfusion:DataGridIndentCell">
658+
<Setter Property="Background"
659+
Value="{Binding Source={RelativeSource Mode=Self},
660+
Converter={StaticResource
661+
Key=cellStyleConverter}}" />
662+
</Style>
663+
</ResourceDictionary>
664+
</ContentPage.Resources>
665+
<syncfusion:SfDataGrid x:Name="dataGrid"
639666
ItemsSource="{Binding Orders}">
640667
<syncfusion:SfDataGrid.GroupColumnDescriptions>
641668
<syncfusion:GroupColumnDescription ColumnName="Name" />
@@ -679,11 +706,8 @@ The visibility of the grouped column can be customized by the [SfDataGrid.ShowCo
679706
ItemsSource="{Binding OrderInfoCollection}"
680707
ShowColumnWhenGrouped="False" />
681708
{% endhighlight %}
682-
683709
{% highlight c# %}
684-
685710
this.dataGrid.ShowColumnWhenGrouped = false;
686-
687711
{% endhighlight %}
688712
{% endtabs %}
689713

0 commit comments

Comments
 (0)