0

I am working on an asp.net mvc-5 web application and I am using entity framework +Razor view.

Currently for more than three weeks I have try and test many web grids , but I cannot find anythat provide the following main features:-

  • compatible with asp.net mvc data annotations, html helpers +model binder.
  • Provide ajax-based paging, filtering sorting
  • Provide server-side processing for the paging, filtering +sorting
  • Provide column-based filtering.

I tried many grids ; for example the Grid.MVC link provides column based filtering but it does not provide ajax-based interaction, also it does not work with mvc data annotations and html helpers. Also I tied the Lib.Web.MVC link but seems it does not provide column based filtering and it lack a sufficient documentations , however it work with data annotation and html helpers.

So my question is basically about what are the available web grids to use inside asp.net mvc, which provides the above four features.? The problem is that on the asp.net mvc books and online domination none of them use any web grids, and most of them implement functions such as paging,filtering, and sorting in a manual way such as link

Can anyone advice on this please, also does any scafilding templetes build their index views based on any grid !!?

1

1 Answer 1

1

If you would provide the input for the grid with respect of html helpers then the grid would have only common HTML fragments in every cell. In the case no column based filtering on the client side could be implemented.

Sorry, but I don't understand the last requirement "Provide column-based filtering". You have already another requirement about ajax-based paging, filtering sorting which means that the server is responsible for filtering (inclusive column-based filtering). So you can expect only that the grid send Ajax request to the server in case of the user type some value in the filter bar and press Enter or "Search".

The first requirement "compatible with asp.net mvc data annotations, html helpers +model binder" is the only requirement which free jqGrid don't satisfy. The reason of it I explained you in the discussion in comments to my previous answer on your another question: jqGrid in pure JavaScript solution. It can't have any MVC components.

Sign up to request clarification or add additional context in comments.

17 Comments

@johnG: Sorry, but ASP.NET MVC works on the server side. It can generates HTML or JavaScript code which can work on the client side, but no pure JavaScript code (like jqGrid, jQuery, ...) can execute some code on the server. JavaScript code can only send some data to the server and nothing more. So only some server code (written in C# for example and not in JavaScript) can have access too the data annotations. One can send the information to the client and some JavaScript code can generate some options of jqGrid. All described above is not part of jqGrid.
@johnG: I wrote already about Lib.Web.MVC. I don't know it and can't help you. Do your hear about quantum physics? I think yes. Do you can answer me on some question from the subject of quantum physics? I think not. You can probably try to search in internet about the question and write the answer. The same for me if you ask me about Lib.Web.MVC.
@johnG: jqGrid get the data from the server via Ajax. So the initial data should be correct. The results of editing (the edited row) will be send back to the server (see here for example the information which will be send by inline editing or here in case of usage form editing). The server should validate the data and then save it in the database.
@johnG: The method called by editurl can return an error (response with some HTTP code which >=400). It can contains the error description in the body. It will inform jqGrid that the data wes not saved and the error returned from the server vill be displayed. So your server can use data annotation to validate the data.
@johnG: You can easy modify the demo project from the old answer to be used in ASP.NET 5. The demo shows how to implement in ASP.NET MVC (using Entity Framework) server side sorting, paging and filtering/searching. I should mention that server side paging and filtering/searching have sense only in you need display the data with really large number of rows. If the approximately number of rows about 1000 then loadonce: true scenario with client side paging/sorting/filtering would be more quickly. The server side will be very small in the case.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.