ASP
  Home arrow ASP arrow Page 6 - ADO.NET 101: Data Rendering with a DataGri...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

ADO.NET 101: Data Rendering with a DataGrid Control
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 78
    2005-11-22

    Table of Contents:
  • ADO.NET 101: Data Rendering with a DataGrid Control
  • Displaying Data from DataReader with a DataGrid Control
  • Connecting to a SQL Server database
  • Adding a SQL Connection
  • Adding a SQLCommand
  • Display formatted data using AutoFormat
  • Formatting via Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ADO.NET 101: Data Rendering with a DataGrid Control - Display formatted data using AutoFormat


    (Page 6 of 7 )

    If you click the link shown in the property window of the DataGrid, you open up the following window where you can choose pre-canned formatting of the DataGrid.

    Scheme selection in autoformat

    For the chosen scheme, Colorful3, the displayed data will be as shown:

    Displayed autoformatted DataGrid
    Autoformatting makes changes to the following aspects of the DataGrid.
    • Appearance
      • Backcolor
      • Bordercolor
      • borderwidth
    • Layout
      • Cellpadding
      • cellspacing
    • Style
      • HeaderStyle
      • FooterStyle
      • AlternatignItemStyle
      • ItemStyle
    Display formatted data by configuring the Properties window

    Design time properties can be set so as to affect the following aspects of the DataGrid. You can make entries to the available design time properties such as:

    Appearance
    Behavior
    Data
    Layout
    Miscellaneous
    Paging
    Style

    You can also mix the methods. You can choose some from AutoFormat and later make some changes to the properties via the Property window. For example some HeaderStyle information is changed here as shown.

    Formtting via DataGrid Property window

     

    With these changes made to the autoformatted data, the browser display is now as shown here.

    Display modified as in picture above

     

    More ASP Articles
    More By Jayaram Krishnaswamy


       · "When the controls are bound to a data source, the three controls Repeater,...
       · I was away on a holiday where I did not have access to a computer(unbelievable, but...
     

    ASP ARTICLES

    - Using MySQL with ASP
    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek