The DetailedUsersItemsView view (described in Chapter 11) contains (Web host server)
The DetailedUsersItemsView view (described in Chapter 11) contains lots of information about transactions, and includes a UserName field, so you could choose that as the view. Then, just choose the columns you want the GridView control to show, as shown in Figure 12-23. You can also choose a sort order using the ORDER BY button. The critical step in the filtering process is limiting records to those that match the name in the DropDownList. Click the WHERE button to get started on that. Then set your options as follows: Column: The name of the column that contains the value needed for filtering; UserName in this example. Operator: This is typically the = operator, but it can be any available operator. Source: Where the value to be searched for comes from. In this example, that would be Control because the value to look for is in a DataList control. Control ID: The name of the control that contains the value to look for; DropDownList1 in this example. So in this example, the selections would look like Figure 12-24. Those selections are just a graphical way of saying Retrieve only rows in which the UserName column s value equals the value of the control named DropDownList1. You must remember to click Add, at which point the selections get translated into SQL. Click OK, click Next, and then click Finish to work your way back to the page. To test the page, view it in the browser. Initially you ll see just the DropDownList control. To view any user s transactions, select that user s name from the dropdown list. The GridView control re-filters each time you make a selection, so you can check out different users. Figure 12-25 shows an example in which Carol is selected in the DropDownList control, so only her transactions are visible in the GridView control below the DropDownList control. Figure 12-23: Columns to show in the GridView control selected. Chapter 12: Using Data in Web Pages 283
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.