لم يتم تجميع Rad Telerik GridgrouptyExpression حتى النقر فوق زر فرز الشبكة
سؤال
لدي Radgrid مع DataTable كما هو مصدر. لدي ما owncompating مجموعة إلى 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 DataBound، قمت بتشغيل ما يلي:
var expression = GridGroupByExpression.Parse(
"recipeId [Recipe], count(recipeId) ingredientsIds [Ingredients]
Group By recipeId");
this.RadGridSearchResults.MasterTableView.GroupByExpressions.Add(expression);
this.RadGridSearchResults.GroupingEnabled = true;
كنت أتوقع أن تبدو رادغريد لي وكأنها لديك هنا بمجرد النقر فوق زر "المجموعة حسب التعبير":
بدلا من ذلك، يبدو هذا:
يبحث فقط مباشرة بعد النقر فوق الزر "فرز":
أي فكرة؟ حاولت حتى استدعاء فرز يدويا ولكن هذا لم ينجح.
المحلول
عند إضافة تعبير المجموعة، هل تسمون طريقة Rebind () للشبكة لتحديث حالتها؟ هذا ضروري في حال تطبيق تجميع من معالج أحداث إعادة النشر التي لا تحمي التحكم ضمنيا.
ديك.
لا تنتمي إلى StackOverflow