Hi,
I have a simple grid with 1 field in the master template, and one field in the child template. I want to use the load on demand, the solution works fine without await/async:
Private Async Sub RadGridView1_RowSourceNeeded(sender As Object, e As GridViewRowSourceNeededEventArgs) Handles RadGridView1.RowSourceNeeded 'Add 3 sub rows Dim row1 As GridViewRowInfo = e.Template.Rows.NewRow row1.Cells(0).Value = "Test 1" e.SourceCollection.Add(row1) Dim row2 As GridViewRowInfo = e.Template.Rows.NewRow row2.Cells(0).Value = "Test 2" e.SourceCollection.Add(row2) Dim row3 As GridViewRowInfo = e.Template.Rows.NewRow row3.Cells(0).Value = "Test 3" e.SourceCollection.Add(row3) End Sub
However, when I use await with the event, the parent row does not auto expand, and the behavior become weird when trying to select child row there is a lot of scrolling and flickering:
Private Async Sub RadGridView1_RowSourceNeededAsync(sender As Object, e As GridViewRowSourceNeededEventArgs) Handles RadGridView1.RowSourceNeeded 'Simulate Await Await Task.Delay(1000) Dim row1 As GridViewRowInfo = e.Template.Rows.NewRow row1.Cells(0).Value = "Test 1" e.SourceCollection.Add(row1) Dim row2 As GridViewRowInfo = e.Template.Rows.NewRow row2.Cells(0).Value = "Test 2" e.SourceCollection.Add(row2) Dim row3 As GridViewRowInfo = e.Template.Rows.NewRow row3.Cells(0).Value = "Test 3" e.SourceCollection.Add(row3) End Sub
Many Thanks
Sameh
