Yahoo web space - Click OK at the bottom of the Query

Click OK at the bottom of the Query Builder. Then click Next, and then click Finish. In Design view, you end up with a FormView control that just shows: Expr1:0 Viewing that page in a Web browser shows something like the example below (though the number will be the sum of whatever values are in the ItemPrice field of the view at the moment): Expr1: 469.4000 As it stands, the information presented by the control isn t exactly selfexplanatory. But you can edit the control s template to show anything you want. First you need to close the Web browser (if it s open) to get back to the Design view of the page. Then right-click the FormView control, choose Show Smart Tag, then choose Edit Templates. To show the sum in currency format rather than in the 469.4000 format, do as you did in the DataList control. That is, right-click [Expr1Label], choose Show Smart Tag, then choose Edit Data Bindings. Set the Format to Currency {0:C} and clear the Two-way databinding check box as shown in Figure 12-62, and click OK. You need only choose Two-way databinding if you intend to edit data in a FormView control. However, if you want to edit data, you d be better off using a DetailsView control, as it s a lot easier with DetailsView. In the ItemTemplate, replace the text Expr1: with Grand Total: as shown in Figure 12-63. When you view the page in a browser, the control shows: Grand Total: $469.40 Figure 12-61: A query to sum the ItemPrice field in Detailed Users ItemsView. Chapter 12: Using Data in Web Pages 313
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply