iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Description
When an attempt is made to filter by an invalid date value, the following exception will be thrown:
The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.
Steps to Reproduce
Expected Results
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.
Actual Results
The exception listed above is returned.
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?
Hello,Thank you for your question regarding WebGrid.I made a work around that you might try. I add validation code in OnBeforeRequest client side event.The code validate whether the input is a valid date format or not.The code will continue the filtering process if the date format is valid.
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; } } }
I implement the validation code in one of WebGrid Sample Solution, PreserveCheckedRows.aspx page.Please kindly have review on the attached sample to see the result.If you can’t get the sample properly, please try to follow this link: http://1drv.ms/1hPGyuQI apologize for any inconvenience this problem may have caused you.Regards,Hans K.
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).
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.
Hello,I am sorry; currently there isn’t any plan to add this work around as a WebGrid feature.I will forward this scenario to the developer team.I will let you know if there is an update regarding this scenario.Thank you and I apologize for the inconvenience.Regards,Hans K.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname