Skip to content

Commit 1a5073e

Browse files
committed
Code changes regarding review corrections.
1 parent 9da73d2 commit 1a5073e

File tree

3 files changed

+48
-8
lines changed

3 files changed

+48
-8
lines changed
20.9 KB
Loading

MAUI/DataGrid/addNew-row.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,52 @@ public partial class MainPage : ContentPage
4545
public MainPage()
4646
{
4747
InitializeComponent();
48-
this.dataGrid.AddNewRowPosition = DataGridAddNewRowPosition.Top;
48+
dataGrid.SelectionMode = DataGridSelectionMode.Single;
49+
dataGrid.NavigationMode = DataGridNavigationMode.Cell;
50+
dataGrid.AllowEditing = true;
51+
dataGrid.AddNewRowPosition = DataGridAddNewRowPosition.Top;
4952
}
5053
}
5154
{% endhighlight %}
5255
{% endtabs %}
5356

5457
<img alt="addnewRowpositon-top" src="Images\addnewrow\maui-dataGrid-AddNewRowPosition-top.png" width="604"/>
5558

56-
## Changing the AddNewRow default text in DataGrid
59+
## Changing the AddNewRow Position
60+
61+
AddNewRow position can be changed by setting `SfDataGrid.AddNewRowPosition` property.
62+
63+
{% tabs %}
64+
{% highlight xaml %}
65+
<syncfusion:SfDataGrid x:Name="dataGrid"
66+
AddNewRowPosition="Bottom"
67+
AddNewRowText="Click here to add new row in datagrid"
68+
SelectionMode="Single"
69+
NavigationMode="Cell"
70+
AllowEditing="True"
71+
AutoGenerateColumnsMode="None"
72+
ItemsSource="{Binding OrderInfoCollection}">
73+
</syncfusion:SfDataGrid>
74+
{% endhighlight %}
75+
{% highlight c# %}
76+
public partial class MainPage : ContentPage
77+
{
78+
public MainPage()
79+
{
80+
InitializeComponent();
81+
dataGrid.SelectionMode = DataGridSelectionMode.Single;
82+
dataGrid.NavigationMode = DataGridNavigationMode.Cell;
83+
dataGrid.AllowEditing = true;
84+
dataGrid.AddNewRowPosition = DataGridAddNewRowPosition.Bottom;
85+
dataGrid.AddNewRowText = "Click here to add new row in datagrid";
86+
}
87+
}
88+
{% endhighlight %}
89+
{% endtabs %}
90+
91+
<img alt="addnewRowpositon-top" src="Images\addnewrow\maui-dataGrid-AddNewRowPosition-bottom.png" width="604"/>
92+
93+
## Changing the AddNewRow default text
5794

5895
You can change the default static string of AddNewRow in datagrid by using the [SfDataGrid.AddNewRowText]() property. The `AddNewRowText` property has higher priority than the text that is localized in resx file.
5996

@@ -75,8 +112,11 @@ public partial class MainPage : ContentPage
75112
public MainPage()
76113
{
77114
InitializeComponent();
78-
this.dataGrid.AddNewRowPosition = DataGridAddNewRowPosition.Top;
79-
this.dataGrid.AddNewRowText = "Click here to add new row in datagrid";
115+
dataGrid.SelectionMode = DataGridSelectionMode.Single;
116+
dataGrid.NavigationMode = DataGridNavigationMode.Cell;
117+
dataGrid.AllowEditing = true;
118+
dataGrid.AddNewRowPosition = DataGridAddNewRowPosition.Top;
119+
dataGrid.AddNewRowText = "Click here to add new row in datagrid";
80120
}
81121
}
82122
{% endhighlight %}
@@ -86,7 +126,7 @@ public partial class MainPage : ContentPage
86126

87127
## Initializing default values for AddNewRow
88128

89-
SfDataGrid allows you to set the default values for AddNewRow while initiating, through [AddNewRowInitiatingEventArgs.NewObject]() property in [SfDataGrid.AddNewRowInitiating]() event.
129+
SfDataGrid allows you to set the default values for AddNewRow while initiating, through [AddNewRowInitiatingEventArgs.Object]() property in [SfDataGrid.AddNewRowInitiating]() event.
90130

91131
{% tabs %}
92132
{% highlight xaml %}
@@ -220,7 +260,7 @@ To customize the AddNewRowText, add the default Syncfusion.SfDataGrid.WPF.resx f
220260

221261
## Customizing AddNewRow
222262

223-
### Implicit Styling of AddNewRow
263+
### Apply implicit style
224264

225265
DataGridAddNewRow can be customized by writing style for [DataGridAddNewRowView]() TargetType.
226266

@@ -243,7 +283,7 @@ DataGridAddNewRow can be customized by writing style for [DataGridAddNewRowView]
243283
{% endhighlight %}
244284
{% endtabs %}
245285

246-
### Default Styling of AddNewRow
286+
### Apply default style
247287

248288
You can customize the AddNewRow's Background, TextColor, FontAttribute, FontFamily by using [SfDataGrid.DefaultStyle]().
249289

maui-toc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@
568568
<li><a href="/maui/DataGrid/master-details-view">Master Details View</a></li>
569569
<li><a href="/maui/DataGrid/record-template-view">Record Template View</a></li>
570570
<li><a href="/maui/DataGrid/Stacked-Header">Stacked Headers</a></li>
571-
<li><a href="/maui/DataGrid/addNew-row">AddNewRows</a></li>
571+
<li><a href="/maui/DataGrid/addNew-row">Add New Rows</a></li>
572572
<li><a href="/maui/DataGrid/load-more">Load More</a></li>
573573
<li><a href="/maui/DataGrid/pull-to-refresh">Pull To Refresh</a></li>
574574
<li><a href="/maui/DataGrid/empty-view">Empty view</a></li>

0 commit comments

Comments
 (0)