CodeSmith Community
Your Code. Your Way. Faster!

Enhancements to GridViewSearchPanel

rated by 0 users
This post has 6 Replies | 1 Follower

Top 10 Contributor
Posts 925
Points 35,460

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 -------------------------------------------------
Not Ranked
Posts 2
Points 40

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
Top 10 Contributor
Posts 925
Points 35,460

Forgot to include the new class - doh!

Patch attached.

hth

swin 

------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
  • | Post Points: 35
Top 10 Contributor
Posts 742
Points 17,965
Awesome! Patch committed (rev.508)

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

Top 10 Contributor
Posts 742
Points 17,965

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
--------------------------------------------------------------

Top 500 Contributor
Posts 18
Points 480

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

Any ideas how to solve.

Thanks

  • | Post Points: 35
Top 10 Contributor
Posts 742
Points 17,965

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