30
2015
05

telerik控件RadGrid分组后无法折叠问题

 一个页面里面放了 一个 telerik 的 RadComboBox ,并且是复选模式;

        <telerik:RadComboBox ID="cbxState" AutoPostBack="true" Enabled="true" CheckedItemsTexts="DisplayAllInInput" DropDownAutoWidth="Disabled" MaxHeight="300"
                                        Localization-CheckAllString="全选" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Width="160px" OnSelectedIndexChanged="ddlMine_SelectedIndexChanged">
       </telerik:RadComboBox>

还放了一个telerik 的RadGrid1 ,并且有分组


                   <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="false" PageSize="50" CellPadding="0" CellSpacing="0" OnItemDataBound="RadGrid1_ItemDataBound"
                        GridLines="None" AllowSorting="true" ShowGroupPanel="false" OnNeedDataSource="RadGrid1_NeedDataSource"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"
                        Skin="MyCustomSkin" EnableEmbeddedSkins="false">
                        <ExportSettings ExportOnlyData="true" HideStructureColumns="true"></ExportSettings>
                        <MasterTableView Width="100%" AllowMultiColumnSorting="true" AllowAutomaticDeletes="true" AutoGenerateColumns="False">
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldAlias="煤矿" FieldName="MineName"
                                            HeaderValueSeparator=":"></telerik:GridGroupByField>
                                    </SelectFields>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="MineName" HeaderText="煤矿名称"></telerik:GridGroupByField>
                                    </GroupByFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="编号" Groupable="false">
                                    <ItemTemplate>
                                        <asp:Literal ID="litIdNo" runat="server" Text='<%# Container.ItemIndex + 1%>'></asp:Literal>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="false" EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                            <Selecting AllowRowSelect="false"></Selecting>
                        </ClientSettings>
                        <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                    </telerik:RadGrid>



出现的问题是无法点击 RadGrid的分组折叠按钮, 出现如下错误提示:

行: 2
错误: Sys.WebForms.PageRequestManagerServerErrorException: 回发或回调参数无效。在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。


解决方法如下,要默认选中 telerik:RadComboBox  里面的内容项,可以选一个或多个,如果不选中任何项就会出现上面的问题。



« 上一篇下一篇 »

相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。