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
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>
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 minutes later...
Ahh sorry this was fixed in Q3...
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".
Hope this helps,
Jeff
Any workaround or fixes for this?
(I am using the current latest build 2009.2)
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.
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)
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.
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.
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.
<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.
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.
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
Have the " and % used in filter was solved in the latest build?
Thx
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