Skip to content

Commit a542c2a

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

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

MAUI/DataGrid/addNew-row.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ public partial class MainPage : ContentPage
5656

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

59-
## Changing the AddNewRow Position
59+
## Changing the AddNewRow position
6060

61-
AddNewRow position can be changed by setting `SfDataGrid.AddNewRowPosition` property.
61+
The position of the AddNewRow in SfDataGrid can be customized using the `SfDataGrid.AddNewRowPosition` property. By default, this property is set to Top.
62+
The following code snippet demonstrates how to change the AddNewRow position to Bottom in SfDataGrid:
6263

6364
{% tabs %}
6465
{% highlight xaml %}
@@ -88,7 +89,38 @@ public partial class MainPage : ContentPage
8889
{% endhighlight %}
8990
{% endtabs %}
9091

91-
<img alt="addnewRowpositon-top" src="Images\addnewrow\maui-dataGrid-AddNewRowPosition-bottom.png" width="604"/>
92+
<img alt="addnewRowpositon-bottom" src="Images\addnewrow\maui-dataGrid-AddNewRowPosition-bottom.png" width="604"/>
93+
94+
## Customize the newly added row position
95+
96+
SfDataGrid adds new data item from AddNewRow at the end of collection. When data operations (sorting, grouping) performed, the new item added based on data operations. You can customize the newly added data item position by setting [SfDataGrid.NewItemPlaceHolderPosition]().
97+
98+
{% tabs %}
99+
{% highlight xaml %}
100+
<syncfusion:SfDataGrid x:Name="dataGrid"
101+
AddNewRowPosition="Top"
102+
SelectionMode="Single"
103+
NavigationMode="Cell"
104+
AllowEditing="True"
105+
NewItemPlaceholderPosition="AtBeginning"
106+
ItemsSource="{Binding OrderInfoCollection}">
107+
</syncfusion:SfDataGrid>
108+
{% endhighlight %}
109+
{% highlight c# %}
110+
public partial class MainPage : ContentPage
111+
{
112+
public MainPage()
113+
{
114+
InitializeComponent();
115+
dataGrid.SelectionMode = DataGridSelectionMode.Single;
116+
dataGrid.NavigationMode = DataGridNavigationMode.Cell;
117+
dataGrid.AllowEditing = true;
118+
dataGrid.AddNewRowPosition = DataGridAddNewRowPosition.Top;
119+
dataGrid.NewItemPlaceholderPosition = Syncfusion.Maui.Data.NewItemPlaceholderPosition.AtBeginning;
120+
}
121+
}
122+
{% endhighlight %}
123+
{% endtabs %}
92124

93125
## Changing the AddNewRow default text
94126

0 commit comments

Comments
 (0)