This question is locked. New answers and comments are not allowed.
Hello,
I used NHibernate as DAL which not support LINQ. I want to use radDomainDataSource as server side paging. Code as following,
In my DomainService:
public IEnumerable<RAF.DTO.Supplier> GetSuppliers(string supplierTypeCode, int firstResult, int maxResults, out int totalCount)
{
IEnumerable<RAF.DTO.Supplier> dtoSuppliers = _suppliers.GetSuppliers(ref _lastSuppliersCount,
DomainEnumerations.MappingType.Grid, supplierTypeCode, firstResult, maxResults);
totalCount = (int)_lastSuppliersCount;
return dtoSuppliers;
}
In the UI Code, I modified Query.Parameters["firstResult"] in order to get correct paged data from DomainService.
void rddsSuppliers_LoadingData(object sender, Telerik.Windows.Controls.DomainServices.LoadingDataEventArgs e)
{
Telerik.Windows.Controls.RadDomainDataSource dataSource = (Telerik.Windows.Controls.RadDomainDataSource)sender;
e.Query.Parameters["firstResult"] = (dataSource.DataView.PageIndex + 1) * dataSource.DataView.PageSize;
e.LoadBehavior = LoadBehavior.RefreshCurrent;
}
But the RadDomainDataSource will append Skip().Take() to my Paged Data, this cause incorrect DataView(no data).My problem is how to get the query send to server without Skip and Take(I have read the thread http://www.telerik.com/community/forums/silverlight/domain-datasource/how-to-get-the-query-sent-to-server-without-skip-and-take.aspx). I using the method "PagingRemover", but I failed to modified the e.Query.Query.Expression because it is read only!
Any idea?
Thanks
I used NHibernate as DAL which not support LINQ. I want to use radDomainDataSource as server side paging. Code as following,
In my DomainService:
public IEnumerable<RAF.DTO.Supplier> GetSuppliers(string supplierTypeCode, int firstResult, int maxResults, out int totalCount)
{
IEnumerable<RAF.DTO.Supplier> dtoSuppliers = _suppliers.GetSuppliers(ref _lastSuppliersCount,
DomainEnumerations.MappingType.Grid, supplierTypeCode, firstResult, maxResults);
totalCount = (int)_lastSuppliersCount;
return dtoSuppliers;
}
In the UI Code, I modified Query.Parameters["firstResult"] in order to get correct paged data from DomainService.
void rddsSuppliers_LoadingData(object sender, Telerik.Windows.Controls.DomainServices.LoadingDataEventArgs e)
{
Telerik.Windows.Controls.RadDomainDataSource dataSource = (Telerik.Windows.Controls.RadDomainDataSource)sender;
e.Query.Parameters["firstResult"] = (dataSource.DataView.PageIndex + 1) * dataSource.DataView.PageSize;
e.LoadBehavior = LoadBehavior.RefreshCurrent;
}
But the RadDomainDataSource will append Skip().Take() to my Paged Data, this cause incorrect DataView(no data).My problem is how to get the query send to server without Skip and Take(I have read the thread http://www.telerik.com/community/forums/silverlight/domain-datasource/how-to-get-the-query-sent-to-server-without-skip-and-take.aspx). I using the method "PagingRemover", but I failed to modified the e.Query.Query.Expression because it is read only!
Any idea?
Thanks