RadGrid Filters not working

16 posts, 0 answers
  1. Jeff Sager
    Jeff Sager avatar
    26 posts
    Member since:
    Aug 2006

    Posted 20 Jan 2009 Link to this post

    Latest Internal Build fixes the problem ASP.NET_AJAX_2008_3_1319

    CORRECTION:  It isn't all of my Radgrids in the project but just some of them (I'm still working on figuring out why some work and other don't)  ADDITION:  It is on any column that is a number.  It doesn't matter if it is gridboundcolumn or a gridnumericcolumn. TEMPORARY FIX I added DataType="System.String"  to the column definition and filtering then works.  It seem like a problem with the filter menu for numeric values.


    I upgraded my sites to and now all of my filtering has stopped working on all of my RadGrids.  They were all working before I upgraded.  I get the error :
    System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
    at System.String.Format(IFormatProvider provider, String format, Object[] args)
    at Telerik.Web.UI.GridFilterFunction.GetFunctionString(String fieldName, String value, Type valueDataType, GridTableView tableView)
    at Telerik.Web.UI.GridColumn.EvaluateFilterExpression(GridFilteringItem filteringItem)
    at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source)
    at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)
    at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
    at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs ar gs)
    at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
    at Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument)
    at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    Thanks in advance,
    Jeff


  2. Jeff Sager
    Jeff Sager avatar
    26 posts
    Member since:
    Aug 2006

    Posted 20 Jan 2009 Link to this post

    Just to add to my previous problem as I'm stumped. Below is the code for the RadGrid, If I filter by JobNo I get the error , if I filter by anything else I don't.  If I move JobNo to a different column, I get the error.  If I change it to a RadNumerIcColumn I still get the error.
    It seems like I'm doing something stupid but I can't figure out what it is.  This really did work before upgrading to the latest version.
    Thanks for any input,
    Jeff

    <telerik:RadGrid ID="rg" runat="server" AllowFilteringByColumn="True"
                AllowPaging="True" AllowSorting="True" GridLines="None"
                Skin="Outlook" AutoGenerateColumns="False" PageSize="30">
    <exportsettings exportonlydata="True" filename="ClosedJobs" ignorepaging="True"></exportsettings>

            <groupingsettings casesensitive="False" />

    <clientsettings allowcolumnsreorder="True">
        <scrolling allowscroll="True" usestaticheaders="True" frozencolumnscount="6" />
            </clientsettings>

    <grouppanel visible="True"></grouppanel>

            <PagerStyle Mode="NextPrevNumericAndAdvanced" />

    <mastertableview allowmulticolumnsorting="True" datakeynames="JobID">

    <editformsettings>
    <popupsettings scrollbars="None"></popupsettings>
    </editformsettings>

    <AlternatingItemStyle BackColor="LightBlue" Font-Bold="False" Font-Italic="False"
                Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True">
            </AlternatingItemStyle>
            
            
            
                         
    <Columns>
    <telerik:GridButtonColumn CommandName="Reprint" HeaderText="Reprint Ticket"
            Text="Reprint" UniqueName="Reprint"></telerik:GridButtonColumn>
    <telerik:GridButtonColumn CommandName="Report" HeaderText="Report" Text="Report"
            UniqueName="Report"></telerik:GridButtonColumn>
            <telerik:GridButtonColumn CommandName="Analysis" HeaderText="Analysis"
            Text="Analysis" UniqueName="Analysis"></telerik:GridButtonColumn>
    <telerik:GridButtonColumn CommandName="Pieces" HeaderText="Items" Text="Items"
            UniqueName="Pieces"></telerik:GridButtonColumn>
    <telerik:GridButtonColumn CommandName="Dismiss"
            ConfirmText="Are you sure you want to DISMISS this job?  You cannot get it back!"
            HeaderText="Dismiss" Text="Dismiss" UniqueName="Dismiss"></telerik:GridButtonColumn>
                         <telerik:GridBoundColumn DataField="JobNo" HeaderText="Job #"
            UniqueName="JobNo">
        </telerik:GridBoundColumn>
        <custom:CustomFiltering  DataField="Customer" HeaderText="Customer"
            UniqueName="Customer">
        </custom:CustomFiltering>
       
        <telerik:GridBoundColumn DataField="Quote" HeaderText="Quote"
            UniqueName="column3"  AllowFiltering="False" >
        </telerik:GridBoundColumn>
         <custom:CustomFiltering  DataField="Service" HeaderText="Service"
            UniqueName="Service">
        </custom:CustomFiltering>
        <custom:CustomFiltering  DataField="Status" HeaderText="Status"
            UniqueName="Status">
        </custom:CustomFiltering>
          <telerik:GridBoundColumn  DataField="AWB" HeaderText="AWB" UniqueName="AWB">
       </telerik:GridBoundColumn>
          <telerik:GridBoundColumn  DataField="Reference" HeaderText="Reference"
            UniqueName="Reference">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Received" DataFormatString="{0:dd/MM/yyyy}"
            DataType="System.DateTime" HeaderText="Received" UniqueName="column9" ItemStyle-Font-Size="XX-Small">
        </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="Closed" DataFormatString="{0:dd/MM/yyyy}"
            DataType="System.DateTime" HeaderText="Closed" UniqueName="column91" ItemStyle-Font-Size="XX-Small">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn AllowFiltering="False" DataField="Kilos"
            HeaderText="Rec Kilos" UniqueName="column7">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn AllowFiltering="False" DataField="ActKgs"
            HeaderText="Act kilos" UniqueName="column10">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActPcs"  AllowFiltering="False" HeaderText="Items"
            UniqueName="column11">
        </telerik:GridBoundColumn>
                         </Columns>
            
            
            
                         

    <expandcollapsecolumn resizable="False" visible="False">
    <HeaderStyle Width="20px"></HeaderStyle>
            
            
            
                         
    </expandcollapsecolumn>

    <rowindicatorcolumn visible="False">
    <HeaderStyle Width="20px"></HeaderStyle>
            
            
            
                         
    </rowindicatorcolumn>
    </mastertableview>

    <filtermenu enabletheming="True" skin="Outlook">
    <collapseanimation duration="200" type="OutQuint"></collapseanimation>
    </filtermenu>

            <filteritemstyle width="50px" horizontalalign="Left" />
    </telerik:RadGrid>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 23 Jan 2009 Link to this post

    Hello Jeff Sager,

    Indeed the issue you have described in your first message is known and has been addressed by our developers. Thus downloading the latest internal build should fix the problem or you may consider temporary setting EnableLinqExpressions option to false.

    Please excuse us for any inconvenience this may caused you.

    All the best,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. arellano
    arellano avatar
    2 posts
    Member since:
    Oct 2008

    Posted 15 Feb 2009 Link to this post

    Anyone working on getting the filter to accept single or double quotes ? Any workarounds out there ? I don't know why  Telerik isn't getting request to get this fix. Any decent web app should be tested with quotes in my opinion. Paging all the way down to page 25 to get to "Ms O'neil" is not acceptable as per my client. Thanks

    5 minutes later...

    Ahh sorry this was fixed in Q3...
  6. arellano
    arellano avatar
    2 posts
    Member since:
    Oct 2008

    Posted 16 Feb 2009 Link to this post

    Downloaded 2008.3.1409.35 internal build. Filtering with quotes is still an issue and seems that its gotten worse. Looks like I'm going back to Q2.
  7. Zach
    Zach avatar
    18 posts
    Member since:
    Jan 2006

    Posted 18 Feb 2009 Link to this post

    I am using the the latest official build 2008.3.1314.35 ASP.NET 3.5.

    IsNull, NotIsNull, IsEmpty, NotIsEmpty all do not work for me.  Could this be a related issue?  I get the error:  "Index was out of range.  Must be non-negative and less than the size of the collection."

    Filtering with numbers or date fields and with quotes works okay after I set EnableLinqExpressions="False".

  8. Jeff Sager
    Jeff Sager avatar
    26 posts
    Member since:
    Aug 2006

    Posted 18 Feb 2009 Link to this post

    I switched to the internal build (2008.3.1319.35) and it fixed the problem you are having for me.  The single quote issue discussed earlier in this thread is still a problem.
    Hope this helps,
    Jeff
  9. Zach
    Zach avatar
    18 posts
    Member since:
    Jan 2006

    Posted 18 Feb 2009 Link to this post

    Good call on the internal build.  2008.3.1417.35 works for me.  The single quote issue works for me as well with that build.
  10. Richard Weissenberg
    Richard  Weissenberg avatar
    11 posts
    Member since:
    Jun 2009

    Posted 08 Jul 2009 Link to this post

    It seems as though filtering with quotes has been fixed. I am having a similar problem when attempting to filter with the '>' or '<'

    Any workaround or fixes for this?

    (I am using the current latest build 2009.2)
  11. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 08 Jul 2009 Link to this post

    Hello Richard,

    Recognizing these symbols ('<' and '>') automatically when entered by the end user as part of the filter pattern is not supported by our web grid. You may consider the approach presented in the video linked under the Filter Functions paragraph of this documentation topic (if applicable for your scenario).

    Best regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  12. G
    G avatar
    3 posts
    Member since:
    Dec 2007

    Posted 16 Jul 2009 Link to this post

    I am running Telerik 2009.1.402.35      and .20
    and I get the same problems on filtering decimal data .
    Integer and character fields can filter fine but  NOT  DataType=System.Decimal

    This is my column declaration 

     

    <telerik:GridNumericColumn Aggregate="Sum"

     

     

     

    DataField="Quantity" DataType="System.Decimal" NumericType=Number

     

     

     

    DataFormatString="{0:N2}" FooterStyle-HorizontalAlign="Right"

     

     

     

    HeaderButtonType="TextButton" HeaderText="Quantity"

     

     

     

    ItemStyle-HorizontalAlign="Right" SortExpression="Quantity"

     

     

     

    UniqueName="Quantity">

     

     

     

    <FooterStyle HorizontalAlign="Right" />

     

     

     

    <ItemStyle HorizontalAlign="Right" />

     

     

     

    </telerik:GridNumericColumn>

    Its bound to a sql server column defined as 

     

    [Quantity] [decimal]

    (13, 5) NOT NULL

    When I filter  a Equal To 6  or anytype of filter attempt I get this error

     

     

    Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

    The StackTrace during the error is documented below.

       at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
       at System.String.Format(IFormatProvider provider, String format, Object[] args)
       at System.String.Format(String format, Object[] args)
       at Telerik.Web.UI.GridFilterFunction.GetFunctionString(String fieldName, String value, Type valueDataType, GridTableView tableView)
       at Telerik.Web.UI.GridColumn.EvaluateFilterExpression(GridFilteringItem filteringItem)
       at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source)
       at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)
       at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
       at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
       at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
       at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
       at Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument)
       at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

     

  13. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 17 Jul 2009 Link to this post

    Hi Gerald,

    You specified that you use the .NET 3.5 build of RadControls under .NET 2.x framework which is not possible. I suppose you use it under ASP.NET 3.5. If this is the case, can you please check whether setting the EnableLinqExpressions property of the control to false addresses the issue you encountered?

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  14. G
    G avatar
    3 posts
    Member since:
    Dec 2007

    Posted 17 Jul 2009 Link to this post

    I narrowed this issue down to the fact of calculated fields exits also n the grid.
    For example.

     

    <telerik:GridCalculatedColumn Aggregate="Sum" DataFields="Price,Quantity"

     

     

    DataFormatString="{0:C2}" DataType="System.Decimal" Expression="({0}*{1})"

     

     

    FooterStyle-HorizontalAlign="Right" HeaderText="TotalCalc"

     

     

    ItemStyle-HorizontalAlign="Right" UniqueName="TotalCalc" AllowFiltering=false>

     

     

    <FooterStyle HorizontalAlign="Right" />

     

     

    <ItemStyle HorizontalAlign="Right" />

     

     

    </telerik:GridCalculatedColumn>

    Even with Allowfiltering off at false will cause the error 
    System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    Character and Integers Filters still work but all the grid bound regular system.decimal fields bounded will fail with when the the GridCalculatedColumn exist . If removed they all work fine very strange.

     

  15. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 20 Jul 2009 Link to this post

    Hello Gerald,

    Does setting the EnableLinqExpressions property to false as suggested in my previous post makes a difference? You may also test the same scenario with the latest release 2009.2.701 of RadControls for ASP.NET AJAX to see whether the problem persists in it.

    However, please have in mind that there are some breaking changes between the Q3 2008 and Q1 2009 release of the suite which are outlined in the following documentation topic:

    http://www.telerik.com/help/aspnet-ajax/radcontrols-changes-backwards-compatibility.html

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  16. Nirav Nayak
    Nirav Nayak avatar
    11 posts
    Member since:
    May 2010

    Posted 14 May 2010 Link to this post



    <ext:ZcGridTemplateColumn UniqueName="FILLRATE" HeaderText="<%$ Resources:UIPagesResources, LBL_FILLRATE_BR_3MONTHS%>" 
                                                SortExpression="FILLRATE" DataField="FILLRATE" AllowFiltering="true" FilterControlWidth="80">  
                                                <ItemStyle Wrap="True" Width="15%" HorizontalAlign="Right" /> 
                                                <HeaderStyle Width="15%" HorizontalAlign="Right" /> 
                                                <ItemTemplate> 
                                                    <div> 
                                                        <%# (Eval("FILLRATE"))!=DBNull.Value?Convert.ToDouble(Eval("FILLRATE")).ToString("0.00") + "%" :"0%"%> 
                                                    </div> 
                                                </ItemTemplate> 
                                            </ext:ZcGridTemplateColumn> 
                                            <ext:ZcGridTemplateColumn UniqueName="FillRateByJobCat" HeaderText="<%$ Resources:UIPagesResources, LBL_FILLRATEBYJOB_BR_3MONTHS%>" 
                                                SortExpression="FillRateByJobCat" DataField="FillRateByJobCat" AllowFiltering="true" 
                                                FilterControlWidth="80">  
                                                <ItemStyle Wrap="True" Width="15%" HorizontalAlign="Right" /> 
                                                <HeaderStyle Width="15%" HorizontalAlign="Right" /> 
                                                <ItemTemplate> 
                                                    <div> 
                                                        <%# (Eval("FillRateByJobCat")) != DBNull.Value ? Convert.ToDouble(Eval("FillRateByJobCat")).ToString("0.00") + "%" : "0%"%> 
                                                    </div> 
                                                </ItemTemplate> 
                                            </ext:ZcGridTemplateColumn> 

    I am not able to short the FillRate Column while i am able to do shorting on FillRateByJobCat Column.
    Database type of both the columns are same. it is Float and we are getting all values in both the columns are "0" only.
    while sorting FillRate Column getting error "Cannot find column -1".

    I tried to change the DataType=System.string and LinqExpression also but it didn't work.
  17. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 14 May 2010 Link to this post

    Hello Nirav,

    This is indeed a strange issue and unfortunately from the details you provided I cannot say for certain what the exact cause of the problem is. Ensure that you are using the latest release 2010.1.415 of the suite and consider submitting:
    •  the entire grid mark up along with the code-behind related to it (using the "Format code block" dialog" from the forum editor)
      or
    • a simplified test case via regular support ticket.

    Thus we will be able to advice you further.
    Kind regards,
    Sebastian
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017