私は、ソートグリッドボタンをクリックするまでラッドTelerik GridGroupByExpressionがグループ化されていません

StackOverflow https://stackoverflow.com/questions/1247444

  •  12-09-2019
  •  | 
  •  

質問

私はそれが元だとしてデータテーブルでRadGridを持っています。 私はAllowCustomPagingがtrueに設定されています。

<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が、その後、彼らはのhref =「http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/expressions/defaultcs.aspx」のrel = "nofollowのを<1のように見えることを期待します「noreferrer>ボタン 『式によりグループ』をクリックしたら、ここを持っています:

その代わり、それは次のようになります:

imgur.com主催

私だけが「ソート」ボタンをクリックした直後に探します:

imgur.com主催

任意の手掛かり?私もソート手動で起動しようとしたが、それは成功しませんでした。

役に立ちましたか?

解決

あなたはグループ式を追加すると

、あなたはその状態を更新するために、グリッドの再バインド()メソッドを呼び出していますか?あなたが暗黙的にコントロールを再バインドしませんポストバックイベントハンドラからグループ化適用の場合にはこれが必要です。

ディック

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top