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

RadGrid Filters not working

19 Answers 1034 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 2
Jeff asked on 20 Jan 2009, 01:10 PM
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


19 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 2
answered on 20 Jan 2009, 02:12 PM
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>
0
Rosen
Telerik team
answered on 23 Jan 2009, 11:28 AM
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.
0
arellano
Top achievements
Rank 1
answered on 16 Feb 2009, 12:36 AM
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...
0
arellano
Top achievements
Rank 1
answered on 17 Feb 2009, 12:38 AM
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.
0
Zach
Top achievements
Rank 1
answered on 18 Feb 2009, 07:49 PM

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".

0
Jeff
Top achievements
Rank 2
answered on 18 Feb 2009, 08:05 PM
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
0
Zach
Top achievements
Rank 1
answered on 18 Feb 2009, 09:22 PM
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.
0
Richard Weissenberg
Top achievements
Rank 1
answered on 08 Jul 2009, 02:40 PM
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)
0
Sebastian
Telerik team
answered on 08 Jul 2009, 03:23 PM
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.
0
G
Top achievements
Rank 1
answered on 16 Jul 2009, 07:56 PM
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)

 

 

0
Sebastian
Telerik team
answered on 17 Jul 2009, 08:50 AM
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.
0
G
Top achievements
Rank 1
answered on 17 Jul 2009, 07:12 PM
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.

 

0
Sebastian
Telerik team
answered on 20 Jul 2009, 10:19 AM
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.
0
Nirav Nayak
Top achievements
Rank 1
answered on 14 May 2010, 12:08 PM


<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.
0
Sebastian
Telerik team
answered on 14 May 2010, 01:08 PM
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.
0
Justin
Top achievements
Rank 1
answered on 21 Jan 2017, 01:58 AM
Just figured I'd chime in, going up 6 years later with the 2014 controls, and bug still exists.  For datetimes and ints, Is Null and Not Is Null does nothing.   Works fine for strings.  
0
Eyup
Telerik team
answered on 25 Jan 2017, 09:48 AM
Hello Justin,

You can try using a more recent version. I've created a sample RadGrid web site to demonstrate that both IsNull and IsNotNull filter functions work properly with Numeric and DateTime values. You can run the attached application and verify the result.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Stas
Top achievements
Rank 1
answered on 26 Feb 2017, 12:57 PM

Have the " and % used in filter was solved in the latest build?

Thx

Orna

0
Eyup
Telerik team
answered on 01 Mar 2017, 12:41 PM
Hi Orna,

I've already replied to this query in your formal support thread. I suggest that we continue our conversation on the mentioned thread.

I will also paste the reply here so other developers with similar requirements may use this info:


Some special characters are not allowed in order to prevent manual meaningful queries from the filter directly. Generally, in SQL syntax the single quotes can be escaped with another single quote:
http://www.telerik.com/forums/filter-data-with-double-quotes#PtLREXKdNEqCKb8ULkohwg

For the default filtering you can try the suggestion provided in the following post:
http://www.telerik.com/forums/radgrid-enable-filter-code-behind#cel1slcp-U-pmV28CfXTrg


You can also check this post for filtering with illegal characters:
http://www.telerik.com/forums/radgrid-filter-with-and-and-or#iMR601r2eUqBd4tiWXBrWg


Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jeff
Top achievements
Rank 2
Answers by
Jeff
Top achievements
Rank 2
Rosen
Telerik team
arellano
Top achievements
Rank 1
Zach
Top achievements
Rank 1
Richard Weissenberg
Top achievements
Rank 1
Sebastian
Telerik team
G
Top achievements
Rank 1
Nirav Nayak
Top achievements
Rank 1
Justin
Top achievements
Rank 1
Eyup
Telerik team
Stas
Top achievements
Rank 1
Share this question
or