0
データテーブルを元にした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のようになります:
代わりに、それは次のようになります。
どれ手がかり:
は、私だけが 'ソート' ボタンをクリックした直後に見ていますか?私は手動で並べ替えを呼び出すことを試みたが、それは成功しなかった。