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
How do we validate the data user enters into the FilterRow?
I have scenerios where there is a Date Column and the user is entering some invalid data/format into its Filter and trying to do a filter. WebGrid throws out an error saying the date format is not correct.
How do I handle those errors so that I can show my custom message instead of the standard WebGrid Error window.
Hi,
You can use OnUnhandledError client side event to change the error message. Below is the sample:
function WebGrid1_OnUnhandledError(controlId, tblName, lastRequestObject, errorString) { var grid = ISGetObject(controlId); grid.SetIdle(); grid.IsInProgress = false; grid.SetStatus1("", "ready", "CommonText/Ready") alert("String was not recognized as a valid date"); return false; }
Best Regards,
Gordon Tumewu
Thanks for the response. But, how do we trap this error on the server side as well? Because we have this unhandled error getting logged in our error log whenever this error happens and our client wants us to handle this error.
I am really sorry but the event only in client side, for now WebGrid didn't have server side event to handle the error. If you want, you can submit this as feature request in our developer network >> My Community Center >> Product Feedback so our development team can check the possibility to implement this feature.
In order to avoid users enter invalid data/format into filter row of DateTime data type column, I suggest you to use “CalendarDropdown” as the column EditType.
Example:
<ISWebGrid:WebGridColumn Caption="BirthDate" DataMember="BirthDate" DataType="System.DateTime" EditType="CalendarDropdown" Name="BirthDate" Width="100px"> </ISWebGrid:WebGridColumn>
By using this kind of edit type on the DateTime data type column, the column can only be edited in CalendarDropDownStyle. This will ensure that the value entered into this column will always in a proper format.
Hope this help.
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