Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!


Dreamweaver MX : The Hidden Tips - Page 2


Troy Dreier
07/24/02

Go to page: 1  2 

Printer Friendly Version

Tip 4: DataGrids
More ASP.NET developers are finding how useful Dreamweaver MX can be to implement DataGrids. The DataGrid is a feature-rich, unique, and powerful tool. For instance, most people know that you can edit items in place with a DataGrid, but few know that you can select the type of control that you want to use for the editing. Instead of using the default TextBox that it gives you, you can choose to use a DropDownList, RadioButtonList or any other bindable control. ASP.NET "asp:textbox" controls are used as the default interface for data entry in edit mode. Thanks to the "Free Form" column type, however, it is possible to use Dreamweaver to build a DataGrid whose edit field for a particular column is an asp:textbox, asp:checkbox, or asp:dropdownlist.

To understanding how to use the "Free Form" column type, read these steps on implementing a dropdownlist.

  1. Open or create an ASP.NET page in Dreamweaver.
  2. Using the Server Behaviors panel, add a DataSet. (we'll call it dsMain.).
  3. Using the Server Behavior Panel, add a DataGrid that uses dsMain.
  4. Delete any columns you don't want to show by selecting those columns one-by-one and pressing the minus button.
  5. Modify any column names or other simple attributes by selecting the columns and pressing the Edit button.
  6. Add a single new column of type "Edit, Update, Cancel Buttons" by pressing the plus button.
  7. Select the column that you want to appear as a dropdown when its row is in "edit mode." For the purposes of this example, we'll select "DEPARTMENT."
  8. Press the "Change Column Type" button and choose "Free Form."
  9. In the resulting dialog, you are first going to set up the appearance of the column when it is not in edit mode. Then, you'll set up its appearance (using a dropdown) in edit mode. To begin, make sure that the Template is set to ItemTemplate. The ItemTemplate controls the appearance when it is NOT in edit mode.
  10. Press the "Add Data Field button". This will allow you to easily add the code necessary to have the column show an particular field value from the DataSet that is bound to this DataGrid. You can add static text, other data fields, or your own code to the edit box labeled Contents. (Remember to remove the nbsp if you don't really want a space to appear in the final display.)
  11. Now change the value of the Template to EditItemTemplate. Here, too, the Contents edit box can have any code you want to appear. This time, however, you are building the display that will be used for this column when this row is in edit mode. You might use something like the code shown in the "Contents:" field of the image below for the dropdownlist code.

    Important: For the ID attribute, use the name of the field in the DataSet that this column will update when in edit mode.

  12. Fill in the appropriate value for the Submit Control With ID edit box. This should be whatever you used for the ID for the dropdownlist. Again, this is the name of a field that you want updated in the DataSet.
  13. Make sure that the Submit As value is correct. It controls how the type of data you are updating in the database.
  14. You may now edit the "DEPARTMENT" column using a dropdownlist.

Note that there are two ways to populate the DataGrid column for "DEPARTMENT." Use the "defaultview" property of the DataSet "dsMain". (In this example, this is the only DataSet available from DataGrid dialog.) Or, you may use a separate DataSet that acts as a lookup table, compliments of the SQL "SELECT DISTINCT .... " syntax.

Tip 5: Cloaking folders and files in your site
Site cloaking enables you to exclude folders and file types in a site from operations such as Get or Put. You can cloak individual folders, but not individual files. To cloak files, you must select a file type, and Dreamweaver cloaks all files of that type. Dreamweaver remembers your settings for each site, so you don't have to make selections each time you work on that site.

For example, if you're working on a large site and don't want to upload your multimedia files each day, you can use site cloaking to cloak your multimedia folder, and the system excludes files in that folder from site operations you perform.

You can cloak folders and file types on the remote or local site. Cloaking excludes cloaked folders and files from the following operations:

    Put, Get, Check In, and Check Out
    Reports
    Select newer local and newer remote
    Sitewide operations, such as check and change links and search/replace
    Synchronize
    Asset panel contents
    Template and library updating

Note that Dreamweaver excludes cloaked templates and library items from Get and Put operations only. Dreamweaver does not exclude these items from batch operations, because it might cause them to get out of sync with their instances.

You can perform an operation on a specific cloaked folder by selecting the item in the Site panel and performing an operation on it. Performing an operation directly on a file or folder overrides cloaking.

Go to page: 1  2 

Printer Friendly Version

Of Interest
· Intranet eXchange Discussion Board


email this page

Tutorials
and more at:
Intranet Journal's Tutorials
Intranet Journal Favorites

Creating a PHP-Based Content Management System

The Spyware Guide

Introduction to Microsoft SharePoint Portal

Intranet Journal
Part of the EarthWeb Network

Managing Editor
Intranet Journal

Tom Dunlap

EarthWeb Home Page
Jupitermedia Home Page

Media Kit




The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers