Results 1 to 5 of 5

Thread: nedd help creating gridview user control with sorting and filtering

  1. #1

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    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

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    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

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  5. #5

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    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
  •  



Click Here to Expand Forum to Full Width