I am using version 2010.2.825.235 and I facing grouping issue:
when I use the ajax binding, and when I drag/drop column to group by then everything work fine. but when using the custome binding and when I drag/drop a column to group by then it not work.
what happened is a new column added to the left with empty header and the grid columns without the header is shifted to the left.
so, if you have a grid with 2 columns and you want to group with column one. then a new column added ( the total is 3 now headers with two columns shifted to the left)
Regards,
Nour Jbour
13 Answers, 1 is accepted
Have you solved the problem ? It seems I have the same effect :(
Mirosław Pragłowski
Not yet, it blocking us, we trying to solve it.
The strange is that the telerik team not response to us.
I will do share once i found the problem,
Regards,
Nour Jbour
I've the same problem while using grouping and custom binding. After looking the source code in Reflector, I think that it's not possible to use both custom binding and group functions.
Actually, when setting the EnableCustomBinding property to true on the grid, the DataProcessor does not process the data source. Because the only way to pass the source to the grid is by a IEnumerable<TEntity> it's impossible to pass a IQueryable<IGrouping<T>> that is attempted by the grid to generate groups...
Why the grid does not take car about the Grouping property and it's Groups collection when generating the UI in a custom binding way ?
Thanks for your response.
Regards,
Julien CORIOLAND
The problem is solved and the solution was in the grid datasource structure. it should be grouped before sending it to the grid:
note that the below "Sort" "Where" and "GroupBy" extenstion are a telerik extensions and i put them all to show you a sample that apply filtering, sorting, grouping.
I am using above a direct json response. you may send a strong type list.var items = from item in Items
select new MyRowViewData()
{
Id = item.Id;
Name = item.Name,
Type = item.Type
};
var jsonGroupedData = new
{
Total = items.TotalItemCount,
Data = items.AsQueryable().Sort(/* telerik sort from request*/).Where(/* telerick filter from request*/).GroupBy(/*telerik grouping from request*/)
};
return Json(jsonGroupedData);
let me know if you need a working sample so I can made small on for you.
Hope this help.
Regards,
Nour Jbour
I'm afraid that current version of our grid extension does not support custom grouping when populated through server binding. However I'm happy to inform you that we have managed to address this limitation and this scenario will be supported with the next internal build. I have attached a small sample which demonstrates a possible implementation.
All the best,Rosen
the Telerik team
Hello Rosen,
Thank you for taking the time to write a sample. I'll try to apply it today on our solution but I think it'll help me to solve my problem.
A solution to enable real custom binding scenarios server side may be to make the DataProcessor accessible when the EnableCustomBinding is set to true. Actually, I've found a workaround using reflection but it's very ugly.
I set manually three private fields of the grid :
- dataSourceIsProcessed => true
- processedDataSource => my processed datasource (AsQueryable)
- totalCount => the item's count for pagination
Is it any way that the properties of the grid’s DataProcessor will be writeable in a custom binding context in the next release?
Thanks for the help
Regards,
Julien CORIOLAND
I'm afraid that incorporating the suggested modification is not possible. As those properties are responsible for DataProcessor's internal state, exposing them in such a way will be inappropriate and may result in unexpected side effects.
Also please note that when CustomBinding option is enabled, the supplied data source internally is assign to processedDataSource without any modifications made to it and the totalCount's value is retrieved from value set through GridPagingSettings' Total property. For more information on Grid's Custom binding please refer to this help article.
Rosen
the Telerik team
Do you have a Visual Studio 2008 version please ? I can't open this version
Thanks
However, it seems that I am having some problems in getting the header and the footer to show up. Whenever I added an aggregate using a ClientGroupFooter or ClientFooter, it is giving me an error:
"You cannot use non generic BindTo overload without EnableCustomBinding set to true"
But I did enable the custom binding. So I am not sure what's going on. Here is the column that I want to perform the aggregate:
columns.Bound(fs => fs.AuthorName).Width(125).Aggregate(agg => agg.Count().Max().Min()).ClientFooterTemplate(
"<#= Count #>");
Any ideas? Thank you.
The error you are experiencing is caused by the fact that aggregates are not fully supported in this scenario. However, we have managed to address the error in question and the fix will be included in the next internal build.
Regards,
Rosen
the Telerik team
With the help of the guys on this thread I'm proud to say that I came to a satisfactory result, pluggable in any type of MVC application without much difficulty and almost none in the settings.
I published the project on Bitbucket and Nuget, please take a look and send me some feedbacks.
https://bitbucket.org/Lunadie/telerikmvcgridcustombindinghelper/wiki/Home
https://nuget.org/packages/TelerikMvcGridCustomBindingHelper
I tried with this sample application.
But in case of binding data .
It returns with exception " cannot bind null value while returning IEnumerable ".
Please help me out.
I want to implement an application which uses entity framework and grid which uses custom paging functionality.