Hi Min,
Greetings from Syncfusion.
We have analyzed your requirement. We have prepared sample based on your requirement. As shown in the code snippet below, we dynamically added data that was not in the DataSource in this sample.
Code snippet
private void Button_Clicked(object sender, EventArgs e)
{
int count = viewModel.EmployeeCollection.Count;
bool isAdded = false;
foreach (var item in viewModel.Collection)
{
isAdded = false;
for (int i = 0; i < count; i++)
{
if (viewModel.EmployeeCollection[i].Name.Contains(item.Name))
{
isAdded = true;
}
}
if (!isAdded)
{
viewModel.EmployeeCollection.Add(item);
}
}
} |
Please check if the sample satisfies your requirement and let us know if you have any concerns.
Regards,
Suganya Sethuraman.