This is a migrated thread and some comments may be shown as answers.

Radgrid Filter

1 Answer 43 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Amar
Top achievements
Rank 1
Amar asked on 16 Jul 2013, 07:49 AM

Hi,
 I am having problem when adding filter on Radgrid. When I  add a filter the Radgrid generates this error: Collection was modified; enumeration operation may not execute. But when I remove the filter the Radgrid works. Below is my Radgrid code. Please help.

 

    <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" DataSourceID="SqlDataSource1" Skin="WebBlue"
        AllowFilteringByColumn="True" AllowSorting="True" PageSize="15" OnItemDataBound="OnItemDataBoundHandler"
        OnUpdateCommand="RadGrid1_UpdateCommand"
        ShowFooter="True" AllowPaging="True" runat="server" GridLines="None"
                    EnableLinqExpressions="False" CellSpacing="0">
 
        <MasterTableView Width="100%"
 
        DataSourceID="SqlDataSource1" HorizontalAlign="NotSet"
            AutoGenerateColumns="False" DataKeyNames="IdCol"
            AllowFilteringByColumn="True">
 
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"
                Created="True"></ExpandCollapseColumn>
    <Columns>
     <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
 
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
 
                </telerik:GridEditCommandColumn>
 
        <telerik:GridBoundColumn DataField="idCol" DataType="System.Int64"
            FilterControlAltText="Filter idCol column" HeaderText="idCol" ReadOnly="True"
            SortExpression="idCol" UniqueName="idCol" >
        </telerik:GridBoundColumn>
 
              <telerik:GridBoundColumn DataField="bondNo"
            FilterControlAltText="Filter bondNo column" HeaderText="bondNo"
            SortExpression="bondNo" UniqueName="bondNo" EditFormColumnIndex="0" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">
        </telerik:GridBoundColumn>
     
        <telerik:GridDropDownColumn  DataSourceID="SqlDataSource3" DataField="transporter"
 
                 ListTextField="transportername" ListValueField="transportername"
                  UniqueName="transporter" SortExpression="transporter" HeaderText="transporter"
                    DropDownControlType="DropDownList" EditFormColumnIndex="1">
     
        </telerik:GridDropDownColumn>
       
        <telerik:GridBoundColumn DataField="GRN" ReadOnly="True"
            FilterControlAltText="Filter GRN column" HeaderText="GRN"
            SortExpression="GRN" UniqueName="GRN" EditFormColumnIndex="3">
        </telerik:GridBoundColumn>
         <telerik:GridNumericColumn DataField="numberOfUnits" DataType="System.Int32"
            FilterControlAltText="Filter numberOfUnits column" HeaderText="numberOfUnits"
            SortExpression="numberOfUnits" UniqueName="numberOfUnits" EditFormColumnIndex="3">
        </telerik:GridNumericColumn>
          
 
              <telerik:GridHyperLinkColumn AllowSorting="False"
            DataNavigateUrlFields="idcol"
            DataNavigateUrlFormatString="PrintGRN.aspx?id={0}&reprint=yes"
            FilterControlAltText="Filter column column" Text="Reprint" UniqueName="column"  ItemStyle-Font-Underline="true">
<ItemStyle Font-Underline="True">
</ItemStyle>
        </telerik:GridHyperLinkColumn>
          
 
    </Columns>
          
    </telerik:RadGrid>

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Dec 2013, 07:38 AM
Hi Amar,

Can you reproduce this issue with any of our demos?
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx

Looking forward to your reply.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Editor
Asked by
Amar
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or