Using jqGrid with asp.net web forms (free version)
I think that working Visual Studio demo projects could help you mostly.
The demo from the answer uses ASHX handler in ASP.NET Web Form application. It uses only free open source package jqGrid which consist from JavaScript code only. The latest version of the source code you can download from github.
Another demo from the answer uses ASHX handler in ASP.NET Web Form application too. It shows how to implement editing of the grid.
I think having both of the demo project you can create application which uses full set of jqGrid features. Moreover the usage of ASHX handler in ASP.NET Web Form define only the way how the client communicate with the server. So you can use any technology which you prefer for the Database access. So You can use either Entity Framework or LINQ to SQL or even more old, but in many cases the best from the performance point of view SqlCommand
with SqlDataReader
.
It's important to understand that you can get the most part from the code examples created for another technology like ASP.NET MVC (see the example, another one, this one or this one). So you can implement Autocomplete, Export to Excel etc features in the ASHX handler in ASP.NET Web Form solution.
Comments
-
Priyank Patel almost 2 years
I am using Asp.net Web Forms , earlier I used this jqGrid sample which is not free , this I realized later , now that the confusion was cleared , I will now have to use jqGrid open source thing as I wont opt for commercial one , Can anyone point me to links for getting started with jqGrid and Asp.Net Web Forms , it would be really great if someone gives an example which will show free columns from a sample table in jqGrid , I found some articles online , but couldnot understand how it works. Any suggestions are welcome. Thanks.
-
Priyank Patel almost 12 yearsthank you , will give it a try , the problem with the demo links you gave was , it was a bit difficult for me to understand the use of .ashx in the project , anyways I will try , will it possible for you to just roughly explain the ashx.cs file for a bit of clarity.thanks for your help.
-
Oleg almost 12 years@freebird: The first demo is very easy. It consist from
Simple.aspx
page having<table id="UsersGrid" ></table><div id="UsersGridPager"></div>
markup and JavaScript code$("#UsersGrid").jqGrid({url: 'jqGridHandler.ashx', datatype: 'json',...});
which convert the empty table to grid. The pagejqGridHandler.ashx
has the codejqGridHandler.ashx.cs
whereBuildJQGridResults
will be used to the simple server response. Another methodGetUsers
will be not used, but it shows howBuildJQGridResults
can be changed to useSqlConnection
instead. -
Oleg almost 12 years@freebird: You are welcome! If you would get later new questions you can asked there me of cause.
-
Priyank Patel almost 12 yearsya I will , the licensed version had quiet good features , does the open source one offer similar features like complex searching,sorting , showing lakhs of records etc.
-
Oleg almost 12 years@freebird: I don't use commercial product jqSuite or other products of trirand.net, but I can use all the features which are in your last comment. The difference is mostly that if you use commercial product you can quickly create application using Visual Studio GUI. The code will be generated for you. If you use free product you have to write more JavaScript code, but you will know exactly what your program do. So you should decide what way corresponds more your requirements.
-
Priyank Patel almost 12 yearsI implemented the sample example according to my needs , it displays records from my table , how do I enable searching to the same grid , I have posted a question as well stackoverflow.com/questions/10698254/… , can you guide me thanks.
-
Oleg almost 12 years@freebird: Do you implemented server side sorting, paging and searching or you implemented sorting and paging only for example and your question is how to implement searching? Which technology you use for the access to the database?
-
Priyank Patel almost 12 yearsI used .ashx file to access the database ,ya my question is how do I implement searching.thanks
-
Oleg almost 12 years@freebird: .ashx file define only how you implement the server side handle, but say nothing about the database access. You are free to use Entity Framework for example or
SqlCommand
which have absolutely different implementation of sorting, paging and searching on the server side. -
Priyank Patel almost 12 yearsshould I post my .ashx file also?
-
Oleg almost 12 years@freebird: the
.ashx
file itself contains no helpful information. Its contains is like<%@ WebHandler Language="C#" CodeBehind="jqGridHandler.ashx.cs" Class="jqGridInWebForm.jqGridHandler" %>
. Helpful information will be in the.ashx.cs
file (like injqGridHandler.ashx.cs
in above example). -
Priyank Patel almost 12 yearsI posted the .cs file in my question ,stackoverflow.com/questions/10698254/… , please check that