Hints for working with GridView in VB 2005

Hints for working with GridView in VB 2005

.NET 2.0 introduced the GridView as a successor to the DataGrid control. As Dino Esposito writes in Move Over DataGrid, There's a New Grid in Town:

 

    Requires Free Membership to View

    When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to provide a unique online resource for developers, architects and development managers tasked with building and maintaining enterprise applications using Visual Basic, C# and the Microsoft .NET platform.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchWinDevelopment.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchWinDevelopment.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

[GridView] fully supports data source components and can automatically handle data operations, such as paging, sorting, and editing, provided its bound data source object supports these capabilities. In addition….it supports multiple primary key fields and exposes some user interface enhancements and a new model for handling and canceling events.

This definition merits mention thanks to a recent blog post by developer Hannes Preishuber, who provides a list of 14 common Visual Basic 2005 GridView functions. The post, which can be read here, includes the following samples:

  • Formatted Boundfield
  • Paging huge amount of data
  • Search data
  • Insert Record
  • Multirow select
  • Calculated row
  • Dropdown in GridView edit mode
  • Nested Master Detail
  • Rows with buttons
  • Full row select and hovering
  • Show the ordering with image
  • Delete Confirmation
  • CSS Control Adapters
  • Smarter UI callback

Preishuber admits that some of these samples may be well known to readers, while others are being replaced by new technology such as ASP.NET AJAX. Nonetheless, his post serves as a handy reference and a starting point for getting acquainted with how GridView works.

More on this topic from SearchVB.com

Tip:  Creating flexible, customized views of data
Reference:  Presenting Data with the DataGridView Control - Ch. 6 of Data Binding with Windows Forms

This was first published in October 2006

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.