Skip to content

Commit 702f742

Browse files
authored
Merge pull request #2 from SuthiYuvaraj/MAUI-3289
Review changes
2 parents 17ed18a + b3c3230 commit 702f742

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ListViewMaui/ListViewMaui/Platforms/Windows/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace ListViewMaui.WinUI;
1111
public partial class App : MauiWinUIApplication
1212
{
1313
/// <summary>
14-
/// Initializes the singleton application object. This is the first line of authored code
15-
/// executed, and as such is the logical equivalent of main() or WinMain().
14+
/// Initializes the singleton application object. This is the first line of authored code executed,
15+
/// and as such is the logical equivalent of main() or WinMain().
1616
/// </summary>
1717
public App()
1818
{

ListViewMaui/ListViewMaui/Platforms/iOS/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class Program
88
// This is the main entry point of the application.
99
static void Main(string[] args)
1010
{
11-
// if you want to use a different Application Delegate class from "AppDelegate"
11+
// If you want to use a different Application Delegate class from "AppDelegate",
1212
// you can specify it here.
1313
UIApplication.Main(args, null, typeof(AppDelegate));
1414
}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# add-item-to-group-in-specific-index-.net-maui-listview
22
How to add an item at a specific index in grouped .NET MAUI ListView (SfListView) ?
33

4-
In `.NET MAUI ListView (SfListView)`, you can add an item at a specific index in a specific group by using the `KeySelector` property and the Key value of each group. Since, each group is identified by its `Key` ,which holds the underlying data related to the group. When a new item is added at runtime, you need to find which group the item belongs to by using `PropertyInfoCollection`, `PropertyName`, and `KeySelector `and after getting the desired group’s `GroupResult` value, insert the particular item into a specified index.
4+
In [.NET MAUI ListView (SfListView)](https://www.syncfusion.com/maui-controls/maui-listview), you can add an item at a specific index in a specific group by using the `KeySelector` property and the Key value of each group. Since, each group is identified by its `Key`,which holds the underlying data related to the group. When a new item is added at runtime, you need to find which group the item belongs to by using `PropertyInfoCollection`, `PropertyName` and `KeySelector`and after getting the desired group’s `GroupResult` value, insert the particular item into a specified index.
55
C#
66
To add new data to the underlying collection in the ViewModel class,
7-
```
7+
```c#
88
var contact = new Contact();
99
contact.ContactName = "Adam";
1010
contact.ContactNumber = "783-457-567";
@@ -13,8 +13,8 @@ contact.ContactImage ="image"+r.Next(0, 28)+".png";
1313
ViewModel.ContactItems.Add(contact);
1414
```
1515

16-
You can determine which group does the newly added item belongs to by using the `KeySelector` property and `Key` value of the group by passing the underlying data into the parameter in the GetGroupResult method.
17-
```
16+
You can determine which group does the newly added item belongs to by using the `KeySelector`property and `Key` value of the group by passing the underlying data into the parameter in the `GetGroupResult` method.
17+
```c#
1818
internal void GetGroupResult(object ItemData)
1919
{
2020
var descriptor = listView.DataSource.GroupDescriptors[0];
@@ -34,14 +34,14 @@ internal void GetGroupResult(object ItemData)
3434
}
3535
```
3636
To add the data into the specific group at the specific index,
37-
```
37+
```c#
3838
internal void InsertItemInGroup(List<object> items, object Item, int InsertAt)
3939
{
4040
items.Remove(Item);
4141
items.Insert(InsertAt, Item);
4242
}
4343
```
44-
Take a moment to peruse the documentation to learn more about grouping and its related operations in the SfListView with code examples.
44+
Take a moment to peruse the [documentation](https://help.syncfusion.com/xamarin/listview/grouping) to learn more about grouping and its related operations in the SfListView with code examples.
4545

4646

4747

0 commit comments

Comments
 (0)