Source for Drag & Drop, Paging , filtering gridview page
Note: There is an updated version of this here
I finally got around to putting a useable C# website solution file together for the Drag & Drop, Paging , filtering gridview page. You can download the zipped vs2005 solution Here .
There are a couple of steps to get it working.
You need to create a new empty database on your SQL server and run the SQL code file that is in the DatabaseSetup folder of the solution this will:
- Create a customer table
- Create a stored procedure to query the customer table as required
- Fill in the customer table with some test data.
You will then need to grant access to those SQL elements so that you can access them from your .net solution.
The solution file contains a single aspx page that holds a standard gridview and code that does all of the logic. The data is accessed from the database via DataClass. I have created an Interface called IpagingFilterDataSource that matches what is required if you want to write your own class to do the datahandling. This will obviously be required if you are going to extend this in anyway.
public interface IPagingFilterDataSource
{
int GetDataSize();
int GetDataSize(string FilterField, string FilterVal);
DataSet GetPage(int Pagesize, int CurrPage, string SortCol, string SortDirection);
DataSet GetPage(int Pagesize, int CurrPage, string SortCol, string SortDirection, string FilterField, string FilterVal);
}
In this solution I put together a class MyCustomSQLPageFilterDataSource which supports the IpagingFilterDataSource and retrieves data from the customers table of the test database via a stored proc called up_Customers_list.
In the page_load event in the default.aspx.cs file there is a line
MyCustomSQLPageFilterDataSource MyDataSource = new MyCustomSQLPageFilterDataSource("SQLServer", "CustomerTestDatabaseName", "Uid", "passwd");
You will need to change this to suit your setup based on the database that you created and the userid and passwd for it.
The solution provides a page with a gridview that supports the following features:
- Click on headers to sort columns
- Drag & Drop headers to re-order columns, changes persist over pages.
- Right click on Column headers and filter on entered values
- Page through data and page size is adjustable in the URL (Count Parameter)
- Exporting to excel and a highly experimental mail merge via word using the “client siding” techniques I have blogged about before.
Here are some additional screen shots of it in action:
Drag and drop in action
Right-click on column header and filter
After Filter Applied
After adjustment of pagesize to 5
5 Comments:
cheap wow power leveling buy wow gold cheapest wow power leveling CHEAP wow gold BUY power leveling CHEAPEST wow powerleveling YangQiang
wow goldwow goldwow goldwow gold
By Anonymous, at 11:40 am, May 06, 2009
Drag and drop of column of gridview works fine in IE but it is not working in Mozilla please tell me
how is it possible
By Unknown, at 7:51 pm, August 07, 2009
Find and download that you need at Rapidshare Search Engine.
Top Site Lists Free Proxy Site Free Download mp3 Michael Jackson song All Michael Jackson Lyrics Hollywood Celebrity Gossip Download Mp3 Gratis
By Anonymous, at 10:07 am, November 13, 2009
Hi,
Did you have any effort to pack these features into a stand-alone custom gridview control ?
By Freelance Yazılım Geliştirici, at 4:05 am, August 10, 2010
hi, i am not able to download the solution. can any one help me to download this features... thanks in advance
By Anonymous, at 4:42 am, May 20, 2015
Post a Comment
<< Home