|
-
Sep 20th, 2010, 06:49 AM
#1
Thread Starter
PowerPoster
nedd help creating gridview user control with sorting and filtering
hey guys,
I find myself always repeating code when it comes to gridviews. I want to build a usercontrol so I can just set a datasource andcolumn types etc and I can use the same control over and over in different projects.
I also want to have sorting and filtering. please help me
-
Sep 20th, 2010, 08:16 AM
#2
Re: nedd help creating gridview user control with sorting and filtering
So, what exactly are you struggling with 
Sounds to me like what you want is a Composite User Control, that contains a GridView, which then has a couple Properties on it that will accept the necessary information, such the DataSource, and also whether or not the GridView does Sorting/Filtering, etc.
http://msdn.microsoft.com/en-us/library/aa479016.aspx
Gary
-
Sep 21st, 2010, 02:24 AM
#3
Thread Starter
PowerPoster
Re: nedd help creating gridview user control with sorting and filtering
thanks gary, i've found this as well. I robably have to make a user control that does this:
http://aspalliance.com/1125_Dynamica...rt_Options.all
as I want to set the gridviews datasource as well as specify the column types dynamically. I don't want to set "Autogenerate" columns to true etc.
what do you think?
also if I go this route, will it be difficult to add filtering for each column. example.
a textbox in the headerrow for each text column that allows you to filter.
a dropdownlist in columns that get data from a lookup table.
and a datepicker for datecolumns that allow you to filter by date ranges.
this will take me a few months to do so I really need your guidance. thanks
-
Sep 23rd, 2010, 01:39 AM
#4
Re: nedd help creating gridview user control with sorting and filtering
Hello,
Sorry for not getting back to you sooner, I sort of forgot about this thread 
Anyway...
Yip, that looks like a decent example to follow.
As for adding the filtering capabilities, I don't see any reason why that would cause any problems, I have seen a number of examples where this has been done.
Sounds like you have an interesting project ahead of you.
Keep us up to date with how things are progressing.
Gary
-
Sep 30th, 2010, 06:42 AM
#5
Thread Starter
PowerPoster
Re: nedd help creating gridview user control with sorting and filtering
hey guys,
i'm really confused and I desperatley need to be put on the right track.
I've seen posts on how to create custom controls etc
I don't know whether I need to create a class library that inherits the Gridview or to make one that Inherits WebControl(with a gridview dynamically added).
Please advise me asap. I need to get moving and i'm badly stuck.
I'd like my final product to be something like this:
http://www.obout.com/grid/grid_filte...e_disable.aspx
An I want to ceate my columns using the DynamicallyTemplatedGridview column class like the one I posted in the earlier thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|