Telerik.Web.UI.RadGrid没有名为GroupByExpressions的公共属性

时间:2015-02-23 16:00:55

标签: asp.net telerik dotnetnuke radgrid

我正在使用DNN学习ASP.NET和C#。

我实际上是想显示一个列表,并将所有元素分组。

由于我对如何操作没有任何想法,我尝试关注the Telerik tutorial

但是我有一个错误,告诉我

Telerik.Web.UI.RadGrid does not have a public property named GroupByExpressions

我为

做了同样的事
GridGroupByExpression, SelectFields, GridGroupByFields, groupByFields, and few others

Telerik Doc about grouping上也进行了搜索,但没有找到任何有帮助的内容,至少是为了理解原因。

我还向Telerik Doc查询了这些元素,当然还有they exist

任何帮助都会受到赞赏。 感谢名单。

这是我的代码

<rad:RadPageView runat="server" ID="RadPageView3">
    <h2>Here my futur awesome work</h2>
    <asp:UpdatePanel runat="server" ID="UpdatePanel1" ChildrenAsTriggers="True" UpdateMode="Conditional">
        <ContentTemplate>
            <rad:RadGrid runat="server" ID="grdCustomer" AutoGenerateColumns="False" GridLines="None" CssClass="dnnRadGrid mgCustomersGrid"
                AllowPaging="true" AllowCustomPaging="true" PageSize="50"  AllowSorting="true" AllowFilteringByColumn="True"
                EnableLinqExpressions="False" OnNeedDataSource="GrdCustomerOnNeedDataSource">
                <GroupingSettings CaseSensitive="false" />
                <ClientSettings AllowDragToGroup="True"/>
                <GroupByExpressions>
                    <rad:GridGroupByExpression>
                        <SelectFields>
                            <rad:GridGroupByField FieldAlias="EndUserCompany" FieldName="EndUserCompany"></rad:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <rad:GridGroupByField FieldName="EndUserCompany" SortOrder="Ascending"></rad:GridGroupByField>
                        </GroupByFields>
                    </rad:GridGroupByExpression>
                </GroupByExpressions>
                <MasterTableView DataKeyNames="EndUserCompany">
                    <Columns>
                        <rad:GridBoundColumn HeaderText="NumLicense" DataField="NumLicense" 
                            FilterControlWidth="99%" ShowFilterIcon="False" AutoPostBackOnFilter="True" />
                        <rad:GridBoundColumn HeaderText="StatusLicense" DataField="StatusLicense" 
                            FilterControlWidth="99%" ShowFilterIcon="False" AutoPostBackOnFilter="True" />
                        <rad:GridBoundColumn HeaderText="NameProduct" DataField="NameProduct" 
                            FilterControlWidth="99%" ShowFilterIcon="False" AutoPostBackOnFilter="True" />
                        <rad:GridTemplateColumn HeaderText="ActiveMaintenance" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50" ItemStyle-HorizontalAlign="Center" AllowFiltering="False">
                            <ItemTemplate>
                                <dnn:DnnImage Runat="server" ID="activeMaintenance" IconKey="Checked" Visible="False" />
                                <dnn:DnnImage Runat="server" ID="noActiveMaintenance" IconKey="Unchecked" Visible="False" />
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                        <rad:GridBoundColumn HeaderText="EndUserCompany" DataField="EndUserCompany" 
                            FilterControlWidth="99%" ShowFilterIcon="False" AutoPostBackOnFilter="True" />
                    </Columns>
                </MasterTableView>
                <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                    <Selecting AllowRowSelect="True"></Selecting>
                    <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                        ResizeGridOnColumnResize="False"></Resizing>
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>

            </rad:RadGrid>
            <input type="hidden" id="hidCookie" runat="Server" /> 
        </ContentTemplate>
    </asp:UpdatePanel>
</rad:RadPageView>

1 个答案:

答案 0 :(得分:3)

GroupByExpressions元素必须是MasterTableView元素的子元素吗?

参考:http://www.telerik.com/help/aspnet-ajax/grid-group-by-declarative-definition.html