@@ -135,17 +135,17 @@ The example below shows how to handle the `SelectedItemsChanged` event to extrac
135
135
public Employee SelectedEmployee { get; set; }
136
136
public List<Employee> TeamMatesList { get; set; }
137
137
138
- protected async Task OnSelect(IEnumerable<Employee> employees)
138
+ protected void OnSelect(IEnumerable<Employee> employees)
139
139
{
140
140
SelectedEmployee = employees.FirstOrDefault();
141
141
// update the collection so that the grid can highlight the correct item
142
142
// when two-way binding is used this happens automatically, but the framework does not allow two-way binding and the event at the same time
143
143
SelectedItems = new List<Employee> { SelectedEmployee };
144
144
145
- await GetChildGridData();
145
+ GetChildGridData(); // note: an async operation here can break the selection and may not even render its results in the view
146
146
}
147
147
148
- async Task GetChildGridData()
148
+ void GetChildGridData()
149
149
{
150
150
if (TeamMatesList == null)
151
151
{
@@ -172,7 +172,7 @@ The example below shows how to handle the `SelectedItemsChanged` event to extrac
172
172
// add default selection and execute its logic. Not required
173
173
SelectedItems = new List<Employee> { GridData.FirstOrDefault() };
174
174
SelectedEmployee = GridData.FirstOrDefault();
175
- await GetChildGridData();
175
+ GetChildGridData();
176
176
}
177
177
178
178
public class Employee
@@ -184,8 +184,6 @@ The example below shows how to handle the `SelectedItemsChanged` event to extrac
184
184
}
185
185
````
186
186
187
- @[ template] ( /_contentTemplates/common/general-info.md#event-callback-can-be-async )
188
-
189
187
@[ template] ( /_contentTemplates/common/issues-and-warnings.md#valuechanged-lambda-required )
190
188
191
189
### Two-way Binding of SelectedItems
0 commit comments