joeharrison714 / MVCGrid.Net

http://mvcgrid.net
MIT License
74 stars 55 forks source link

Validating search parameters #32

Open alexangas opened 8 years ago

alexangas commented 8 years ago

I have a requirement to show a validation/error message to the user when the date value of one search parameter is greater than the date value of another. They would prefer it to be shown using the jQuery (unobtrusive) validation library but I think it will be OK to use the WithErrorMessageHtml() option.

The only thing is, this doesn't appear to provide access to the exception in any way (or this is not documented). Ideally, the exception and GridContext would be provided for use to generate the message from a lambda expression. For example something like: grid.WithErrorMessageHtml((ex, c) => @"<div class=""alert alert-danger"" role=""alert"">" + ex.Message + "</div>")

What do you think? Also - thank you for this library, it is very awesome!