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
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
Forgot to include the new class - doh!
Patch attached.
hth
Mike Shatny--------------------------------------------------------------Member of the .netTiers team http://www.nettiers.com--------------------------------------------------------------
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>
The <fieldstoExclude> items do not persist when the gridvoew is sorted or paged.
Any ideas how to solve.
Thanks
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?