Hi all,
First of all, we are using LLBLGEN at our proffesional sw company for about 2 years and it is a life saver product definitely. We are so glad to be its customer.
My question is,
I am using LLBLGEN Data Sources generally, but at one project one of our developers preferred to handle bindings manually, without using DSs. And as i review the code, I saw his code for binding like that:
TestCollection testCollection = new TestCollection();
IPredicateExpression filter = new PredicateExpression();
filter.AddWithAnd(TestFields.LanguageId == new Guid(LanguageCriteriaDropDownList.SelectedValue));
testCollection.GetMulti(filter);
//SORT EXPRESSION IS PASSED FROM THE DATAGRID'S
//SORTING EVENT ACCORDING TO THE HEADER CLICKED
if (sortExpression.Length != 0)
{
testCollection.Sort(sortExpression, (System.ComponentModel.ListSortDirection) sortDirection, null);
}
TestGridView.DataSource = testCollection;
TestGridView.DataBind();
As you can see, once it is retrieving the whole data, then it is sorting and paging through the whole collection. That is ofcourse a performance problem. And if we have used a DS, it would have surely retrieve only needed data (fully, i hope it
)
Now, we have a paging enabled datagridview with some headers for sorting. And we do not have any datasets... How can we handle sorting and paging?
PS: I do not prefer a lame code like this:
if (sortExpression == "Field1")
{
testCollection.GetMulti(filter, 0, sortExpression1);
}else if (sortExpression == "Field2")
{
testCollection.GetMulti(filter, 0, sortExpression2);
}
Thank you for your concern...