外文翻译-英文文献-使用两个DropDownList过滤的主从报表.doc
《外文翻译-英文文献-使用两个DropDownList过滤的主从报表.doc》由会员分享,可在线阅读,更多相关《外文翻译-英文文献-使用两个DropDownList过滤的主从报表.doc(30页珍藏版)》请在咨信网上搜索。
1、 Master/Detail Filtering With Two DropDownListsIntroductionIn the previous tutorial we examined how to display a simple master/details report using a single DropDownList populated with the categories and a GridView showing those products that belong to the selected category. This report pattern work
2、s well when displaying records that have a one-to-many relationship and can easily be extended to work for scenarios that include multiple one-to-many relationships. For example, an order entry system would have tables that correspond to customers, orders, and order line items. A given customer may
3、have multiple orders with each order consisting of multiple items. Such data can be presented to the user with two DropDownLists and a GridView. The first DropDownList would have a list item for each customer in the database with the second ones contents being the orders placed by the selected custo
4、mer. A GridView would list the line items from the selected order.While the Northwind database include the canonical customer/order/order details information in its Customers, Orders, and Order Details tables, these tables arent captured in our architecture. Nonetheless, we can still illustrate usin
5、g two dependent DropDownLists. The first DropDownList will list the categories and the second the products belonging to the selected category. A DetailsView will then list the details of the selected product.Step 1: Creating and Populating the Categories DropDownListOur first goal is to add the Drop
6、DownList that lists the categories. These steps were examined in detail in the preceding tutorial, but are summarized here for completeness. Open the MasterDetailsDetails.aspx page in the Filtering folder, add a DropDownList to the page, set its ID property to Categories, and then click the Configur
7、e Data Source link in its smart tag. From the Data Source Configuration Wizard choose to add a new data source.Figure 1: Add a New Data Source for the DropDownList (Click to view full-size image)The new data source should, naturally, be an ObjectDataSource. Name this new ObjectDataSource CategoriesD
8、ataSource and have it invoke the CategoriesBLL objects GetCategories() method.Figure 2: Choose to Use the CategoriesBLL Class (Click to view full-size image)Figure 3: Configure the ObjectDataSource to Use the GetCategories() Method (Click to view full-size image)After configuring the ObjectDataSourc
9、e we still need to specify which data source field should be displayed in the Categories DropDownList and which one should be configured as the value for the list item. Set the CategoryName field as the display and CategoryID as the value for each list item.Figure 4: Have the DropDownList Display th
10、e CategoryName Field and Use CategoryID as the Value (Click to view full-size image)At this point we have a DropDownList control (Categories) thats populated with the records from the Categories table. When the user chooses a new category from the DropDownList well want a postback to occur in order
11、to refresh the product DropDownList that were going to create in Step 2. Therefore, check the Enable AutoPostBack option from the categories DropDownLists smart tag.Figure 5: Enable AutoPostBack for the Categories DropDownList (Click to view full-size image)Step 2: Displaying the Selected Categorys
12、Products in a Second DropDownListWith the Categories DropDownList completed, our next step is to display a DropDownList of products belonging to the selected category. To accomplish this, add another DropDownList to the page named ProductsByCategory. As with the Categories DropDownList, create a new
13、 ObjectDataSource for the ProductsByCategory DropDownList named ProductsByCategoryDataSource.Figure 6: Add a New Data Source for the ProductsByCategory DropDownList (Click to view full-size image)Figure 7: Create a New ObjectDataSource Named ProductsByCategoryDataSource (Click to view full-size imag
14、e)Since the ProductsByCategory DropDownList needs to display just those products belonging to the selected category, have the ObjectDataSource invoke the GetProductsByCategoryID(categoryID) method from the ProductsBLL object.Figure 8: Choose to Use the ProductsBLL Class (Click to view full-size imag
15、e)Figure 9: Configure the ObjectDataSource to Use the GetProductsByCategoryID(categoryID) Method (Click to view full-size image)In the final step of the wizard we need to specify the value of the categoryID parameter. Assign this parameter to the selected item from the Categories DropDownList.Figure
16、 10: Pull the categoryID Parameter Value from the Categories DropDownList (Click to view full-size image)With the ObjectDataSource configured, all that remains is to specify what data source fields are used for the display and value of the DropDownLists items. Display the ProductName field and use t
17、he ProductID field as the value.Figure 11: Specify the Data Source Fields Used for the DropDownLists ListItems Text and Value Properties (Click to view full-size image)With the ObjectDataSource and ProductsByCategory DropDownList configured our page will display two DropDownLists: the first will lis
18、t all of the categories while the second will list those products belonging to the selected category. When the user selects a new category from the first DropDownList, a postback will ensue and the second DropDownList will be rebound, showing those products that belong to the newly selected category
19、. Figures 12 and 13 show MasterDetailsDetails.aspx in action when viewed through a browser.Figure 12: When First Visiting the Page, the Beverages Category is Selected (Click to view full-size image)Figure 13: Choosing a Different Category Displays the New Categorys Products (Click to view full-size
20、image)Currently the productsByCategory DropDownList, when changed, does not cause a postback. However, we will want a postback to occur once we add a DetailsView to display the selected products details (Step 3). Therefore, check the Enable AutoPostBack checkbox from the productsByCategory DropDownL
21、ists smart tag.Figure 14: Enable the AutoPostBack Feature for the productsByCategory DropDownList (Click to view full-size image)Step 3: Using a DetailsView to Display Details for the Selected ProductThe final step is to display the details for the selected product in a DetailsView. To accomplish th
22、is, add a DetailsView to the page, set its ID property to ProductDetails, and create a new ObjectDataSource for it. Configure this ObjectDataSource to pull its data from the ProductsBLL classs GetProductByProductID(productID) method using the selected value of the ProductsByCategory DropDownList for
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 外文 翻译 英文 文献 使用 两个 DropDownList 过滤 主从 报表
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【可****】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【可****】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。