5/8/11

How to Use Grid View

A GridView object is a pre-made .NET Visual Studio control that lets you lay out data for your website's users. It is automatically drawn for you, and looks similar to a table or Excel spreadsheet. Its main advantage is that you don't need to manually code for a table to hold data.
    • 1

      Double-click your Visual Studio project. The left side of the window has all your .NET controls. Drag and drop the GridView control from the toolbox to your Web form. The control is automatically drawn for you, so all you need to do is set up the properties.

    • 2

      Click the GridView on your form. A small link is shown on the top right. This is the menu where you format the control. Click the link and select "Auto Format" from the pop-up menu. This opens a dialog box where you can format the color scheme for the code. Click a color scheme name on the left. The right side of the window gives you a preview. Click "OK" to save the settings.

    • 3

      Click the GridView menu link and select "Edit Columns." Click the "Add" button to insert a new GridView column. The right side of the column properties window lets you set up your preferences. Most preferences are optional, but you must specify a name in the "Name" section and the data the column holds. Click "OK" when you finish the column setup.

    • 4

      Click the "Run" arrow button at the top of your Visual Studio console. This saves and executes you new GridView page. The GridView is shown in the browser so that you can evaluate the size, colors and data. Review the contents and click "Stop" to return to the programming console.

  • No comments: