﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Error when filtering by invalid date</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-when-filtering-by-invalid-date/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Error when filtering by invalid date</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-when-filtering-by-invalid-date/</link><pubDate>Wed, 16 Apr 2014 06:04:36 GMT</pubDate><dc:creator>Hans</dc:creator><category>Filter</category><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I am sorry; currently there isn’t any plan to add this work around as a WebGrid feature.&lt;br /&gt;I will forward this scenario to the developer team.&lt;br /&gt;I will let you know if there is an update regarding this scenario.&lt;br /&gt;&lt;br /&gt;Thank you and I apologize for the inconvenience.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans K.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Error when filtering by invalid date</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-when-filtering-by-invalid-date/</link><pubDate>Tue, 15 Apr 2014 10:38:16 GMT</pubDate><dc:creator>timby</dc:creator><category>Filter</category><description>&lt;p&gt;Thank you for your reply. I have modified the workaround to meet my needs and it is acceptable for now (I changed it to loop through the cells and check for System.DateTime column types and "Invalid Date" values).&lt;/p&gt;&lt;p&gt;Are there any plans to change the code so that it's more consistent with other filter types? For example, to return 0 results when an invalid value is entered rather than throwing an exception? Without it, we need to add a workaround similar to this for each grid that has a System.DateTime filter.&lt;/p&gt;</description></item><item><title>Error when filtering by invalid date</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-when-filtering-by-invalid-date/</link><pubDate>Mon, 14 Apr 2014 23:07:25 GMT</pubDate><dc:creator>Hans</dc:creator><category>Filter</category><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for your question regarding WebGrid.&lt;br /&gt;&lt;br /&gt;I made a work around that you might try. I add validation code in OnBeforeRequest client side event.&lt;br /&gt;The code validate whether the input is a valid date format or not.&lt;br /&gt;The code will continue the filtering process if the date format is valid.&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;function DoBeforeRequest(gridId, action) {	var grid = ISGetObject(gridId);
	if (action == "ColumnFilter") {
		var selObj = grid.GetSelectedObject();
		var rowObj = selObj.ToRowObject();
		var cellRequiredDate = rowObj.GetCells()[5];
		var dateValue = cellRequiredDate.Value.toString();
		if (dateValue == "Invalid Date") {
			alert("Please insert valid date");
			return false;
		}
		else {
			alert("Thank you");
			return true;
		}
	}
}
&lt;/pre&gt;
&lt;p&gt;I implement the validation code in one of WebGrid Sample Solution, PreserveCheckedRows.aspx page.&lt;br /&gt;Please kindly have review on the attached sample to see the result.&lt;br /&gt;&lt;br /&gt;If you can’t get the sample properly, please try to follow this link: http://1drv.ms/1hPGyuQ&lt;br /&gt;&lt;br /&gt;I apologize for any inconvenience this problem may have caused you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans K.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Error when filtering by invalid date</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Error-when-filtering-by-invalid-date/</link><pubDate>Fri, 11 Apr 2014 11:14:06 GMT</pubDate><dc:creator>timby</dc:creator><category>Filter</category><description>&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;When an attempt is made to filter by an
invalid date value, the following exception will be thrown:&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 15pt 0cm 7.5pt; background: rgb(245, 245, 245);"&gt;&lt;i&gt;&lt;span style="font-size: 14pt; font-family: verdana, sans-serif; color: maroon;"&gt;The string was not recognized as a valid DateTime.
There is an unknown word starting at index 0.&lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: 14pt; font-family: verdana, sans-serif; color: maroon;"&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;Steps to Reproduce&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol start="1" type="1"&gt;
 &lt;li class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;Enter
     "abc" in a date filter and apply the filter&lt;o:p /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;Expected Results&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;The grid is filtered and 0 results are
returned, similar to how other filter types work. For example, when an invalid
filter (such as "abc") is entered and applied for a numeric filter, 0
results are returned.&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;Actual Results&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;The exception listed above is returned.&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 7.5pt 0cm;"&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif;"&gt;Can you please let me know if / when
this will be fixed. If it cannot be fixed soon (within a week), can you please
let me know how I can workaround this issue so that the same functainality can
be achevied?&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;





















&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;</description></item></channel></rss>