I am currently working on a solution where I wanted to use Ideablade DevForce as source for the grid. I already found a good solution on your forums to get this working. I added grouping support with the following code (this is called from the LoadData event):
The only problem I have is that if I group before all the items are loaded nothing gets loaded anymore. In my example I load 20 lines from 100 total lines. If I scroll down after I grouped the items no ItemChanged is sent from the grid.
Another problem I found was that the grid seems to be a bit too "eager" when loading data. This means that if the user tries to scroll to the bottom - without any interrest in the data in the middle - the grid always calls the loading method instead of waiting for the user to finish.
BTW: does the grid create all empty lines on the start or is there some internal limit to this? It just looked to me if the grid creates as many empty lines as the number in VirtualItemCount.
public
void
LoadData(
int
startIndex,
int
itemCount)
{
var baseQuery = (EntityQuery<T>) Query
.Where(FilterDescriptors);
baseQuery = (EntityQuery<T>) Query.GroupBy(GroupDescriptors);
// Skip needs an order
// if (SortDescriptors.Count == 0)// SortDescriptions.Add(new SortDescription(InitialOrderBy.ToString(), InitialOrderByDirection));
//SortDescriptions.Add(new SortDescription("Sid", ListSortDirection.Ascending));
var resultQuery = (EntityQuery<T>) QueryableExtensions.Take(baseQuery
.Sort(SortDescriptors)
.Skip(startIndex), itemCount);
resultQuery.QueryStrategy =
new
QueryStrategy(FetchStrategy.DataSourceAndCache,
MergeStrategy.PreserveChanges);
resultQuery.ExecuteAsync().Completed += (s, e) => { Load(startIndex, e.Results); };
}
The only problem I have is that if I group before all the items are loaded nothing gets loaded anymore. In my example I load 20 lines from 100 total lines. If I scroll down after I grouped the items no ItemChanged is sent from the grid.
Another problem I found was that the grid seems to be a bit too "eager" when loading data. This means that if the user tries to scroll to the bottom - without any interrest in the data in the middle - the grid always calls the loading method instead of waiting for the user to finish.
BTW: does the grid create all empty lines on the start or is there some internal limit to this? It just looked to me if the grid creates as many empty lines as the number in VirtualItemCount.