CodeSmith Community
Your Code. Your Way. Faster!

Enhancements to GridViewSearchPanel

Latest post 10-16-2007 9:03 AM by mike123. 6 replies.
  • 02-23-2007 9:40 AM

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 924
    • Points 34,750

    Enhancements to GridViewSearchPanel

    I've added some enhancements to the GridViewSearchPanel in the attached patch. The notable enhancements are as follows:

    1. The search Field, Operator and Value are now all exposed as properties.

    2. The ability to persist the key properties of both the search panel the associated gridview.  Persistence can be in a session (the default), a client session cookie or a persistent client cookie.

    3. New class GridViewSearchPanelState created to maintain state for above.

    4. The dropdownlist of fields is expanded to show all fields on the table that you would reasonably expect to search - even if they do not appear in the gridview.

    5. New search operator - "Ends with".

    7. Some FormUtil methods to handle the wiring up of the persistence into one method (put in OnInt method) call so all actions on the search panel and gridview are taken care off.

    8. Wired up the admin functions.

    swin 

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 02-23-2007 10:45 AM In reply to

    • TomKnox
    • Not Ranked
    • Joined on 11-01-2006
    • Posts 2
    • Points 40

    Re: Enhancements to GridViewSearchPanel

    Your revision is producing an build failure.


    ---------------- Compile started -----------------

    F:\PromotionalOffice\newnettiers\Source\TemplateLib\FrameworkTemplates.cst(192,0): error CODESMITH0002: Registered template file "F:\PromotionalOffice\newnettiers\Source\TemplateLib\..\WebLibrary\UI\GridViewSearchPanelState.cs.cst" does not exist.

    Build complete -- 1 errors, 0 warnings

    ---------------------- Done ----------------------

    Build failed

    • Post Points: 35
  • 02-23-2007 10:56 AM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 924
    • Points 34,750

    Re: Enhancements to GridViewSearchPanel

    Forgot to include the new class - doh!

    Patch attached.

    hth

    swin 

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 02-23-2007 1:09 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 734
    • Points 17,040

    Re: Enhancements to GridViewSearchPanel

    Awesome! Patch committed (rev.508)

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 5
  • 02-23-2007 2:49 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 734
    • Points 17,040

    Re: Enhancements to GridViewSearchPanel

    I have also added support for exclusion fields from the list if necessary

            <data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" Visible="true" >
                <FieldsToExclude>
                    <data:Field Value="Fax" />
                    <data:Field Value="Phone" />
                    <data:Field Value="CustomerID" />
                </FieldsToExclude>

            </data:GridViewSearchPanel>

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 35
  • 10-15-2007 11:33 PM In reply to

    Re: Enhancements to GridViewSearchPanel

    The <fieldstoExclude> items do not persist when the gridvoew is sorted or paged.

    Any ideas how to solve.

    Thanks

    • Post Points: 35
  • 10-16-2007 9:03 AM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 734
    • Points 17,040

    Re: Enhancements to GridViewSearchPanel

    matt,

     Hmm .. i couldn't replicate the problem. Just to make sure i understand you ... you're setting the field or fields to exclude them from the search criteria dropdownlist, and whenever gridview sorted/paged the field/ appears back in the list?

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 5
Page 1 of 1 (7 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems