У меня есть RadGrid с источником данных, который является источником. У меня AllowCustomPaging установлен в true.Rad Telerik GridGroupByExpression не сгруппирован до тех пор, пока не нажмем кнопку сетки сортировки
<telerik:RadGrid runat="server" ID="RadGridSearchResults"
PageSize="50" AllowPaging="true" AllowCustomPaging="true"
OnNeedDataSource="RadGridSearchResults_NeedDataSource" Skin="Default">
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:RadGrid>
Код для моего кода позади метод RadGridSearchResults_NeedDataSource просто заполняет и возвращает DataTable со следующими столбцами:
dataTableSearchResults.Columns.Add("recipeId", typeof(string));
dataTableSearchResults.Columns.Add("ingredientsIds", typeof(string));
dataTableSearchResults.Columns.Add("country", typeof(string));
dataTableSearchResults.Columns.Add("author", typeof(string));
dataTableSearchResults.Columns.Add("style", typeof(string));
dataTableSearchResults.Columns.Add("friendly", typeof(string));
dataTableSearchResults.Columns.Add("name", typeof(string));
После RadGrid является привязкой к данным, я бегу следующее:
var expression = GridGroupByExpression.Parse(
"recipeId [Recipe], count(recipeId) ingredientsIds [Ingredients]
Group By recipeId");
this.RadGridSearchResults.MasterTableView.GroupByExpressions.Add(expression);
this.RadGridSearchResults.GroupingEnabled = true;
Я бы ожидал, что мой radgrid будет выглядеть так, как он have here, как только вы нажмете кнопку «Группа по выражению»:
Вместо этого он выглядит следующим образом:
Только глядя прямо после того, как я нажимаю кнопку 'сортировать':
Любой ключ? Я даже попытался вызвать сортировку вручную, но это было неудачно.