Customizing Quick Selector Pages

Although Quick Selector table control looks similar to generic table controls, not all layout or code customizations for generic table controls are appropriate for Quick Selector table control.   Quick Selector table controls executes query with SELECT DISTINCT clause to get a list of unique row items to display. By default these items will be assigned to the text property of the QuickSelectorItem using Formula SelectorTableControl.GetQuickSelectorDisplayText.  Note, that if items to be selected are not primary keys of the table, no primary key will be included by default in the Quick Selector’s records. For example, if you have a list of Countries to select from, which is populated from the Customers table, no primary key will be included in the Quick Selector item. Such design ensures that you will get only unique countries in the list, while in the underlying table there might be thousands of records with the same country.

Although this design provides correct result set it has its limitations. Certain controls such as images, row edit, delete and show buttons, any controls with pop-up such as large text fields or child panels require Primary key to be functional. If you drop any of such controls into Quick Selector’s row and your Quick selector does not include Primary key by default you may also drag and drop Primary Key field from the toolbox. You may set visible property for this field to False on the Property Window to hide it, but Quick Selector’s results set will change to include every row of the underlying table. 

It is possible to use Formula in the Quick Selector page in a similar way that it is used everywhere else with one important limitation: any database field included in the Formula should be included in the Quick Selector as well. So for example if QuickSelector has only EmployeeID in the query and you want a Formula to use First and Last names, you need to configure the data source.

Step 1: In the Property Sheet, open the TableControlQuery

Step 2: In the Query Wizard, go to the “SELECT” step

Step 3: Select “Manually select fields”

Step 4: Include EmployeeID, FirstName, and LastName

You can also populate Quick Selector pages using other database tables or views.  For example, you have a Quick Selector button that shows rows from Products table.  To make the Quick Selector shows rows form from Current Product List view, you need to do the following:

On the Quick Selector button, specify Pop-up file path to be “../Current-Product-List/ Current-Product-List-QuickSelector.aspx”

On the property window for the Quick Selector button, specify Index field be “Current Product List.ProductId”

On the formula for the Quick Selector button, in the Property Sheet, Action section, specify a Display text formula such as “=Current_Product_List.ProductName”.   Display text formula sets the display text on each row on the Quick Selector page and the Quick Selector button text.  You can right mouse-click on the formula textbox to get a list of available fields for the formula.

Once you make changes on a Quick Selector page, all Quick Selector buttons redirect to this Quick Selector page will show you the new effect.  If you only want certain Quick Selector buttons to show the new effect, you can to duplicate the Quick Selector Page, make changes according to what you need on the new copy, and set the Pop-up path of the Quick Selector button to be the new path.

You can change any other control type to QuickSelector via the Control Type property in the Property Sheet. Do not forget to also specify relative URL to the QuickSelector ASPX file in Pop-up file path as above.