In this article I would like to consider the customization of the both the FilterBox (aka FilterScreen) and the List (aka ResultsGrid) used in a ListPage class.
I have written about the use of the ListPage class previously.
Creating a ListPage that can be Used in Multiple Contexts
Mixing the Specialised ListPage class with an EntryGroup
The constructor of the ListPage class makes it very easy to link up a FilterBox with a List, but it may not be immediately obvious how to control the properties of either of these.
using Sage.CRM.WebObject; namespace myProject { public class myClass : ListPage { public myClass() : base("Opportunity", "OpportunityList", "OpportunityFilterBox") { FilterByField = "oppo_primarycompanyid"; FilterByContextId = (int)Sage.KeyList.CompanyId; } } }
But the List and FilterBox are available within the class.
e.g.
using Sage.CRM.WebObject; using Sage.CRM.Controls; namespace myProject { public class myClass : ListPage { public myClass() : base("Opportunity", "OpportunityList", "OpportunityFilterBox") { FilterByField = "oppo_primarycompanyid"; FilterByContextId = (int)Sage.KeyList.CompanyId; ResultsGrid.RowsPerScreen = 3; Entry myEntry = new Entry("oppo_customerref"); myEntry.NewLine = true; FilterScreen.Add(myEntry); } } }
- ResultsGrid contains the current List class used in the ListPage class.
- FilterScreen contains the EntryGroup class used in the ListPage class.
Note: I changed the code above to reference the Name space Sage.CRM.Controls.
If you use the code snippets in the .NET SDK you will see that the ListPage examples contain a hints that these classes can be used.