Creating Custom Data Field Controls - Part 1
page 1 of 5
Published: 04 Jan 2008
This article discusses the basics of creating custom data control fields that can be used in the ever popular GridView and DetailsView controls. It will also show you a base class that Brian uses to simplify this process altogether.
by Brian Mains
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 25993/ 65


There are a few controls in the .NET Framework that support bulk amounts of data. All controls can contain some sort of data, but to show groups of data, to paginate or sort it, and perform some sort of analysis limits the number of control support to the GridView, DetailsView, DataList, and a few others. However, some of these controls are limited in their capability, meaning that out-of-the-box does not always cut it.

For the GridView, the TemplateField provides some flexibility. However, having to repeat templates in several places quickly challenges reusability. But, controls like the GridView allow for minor customizations by allowing the developer to reuse specific pieces within its grid, rather than having to recreate a custom control itself. This can be done simply by creating a new custom control that inherits from DataControlField.

So, the focus of this article will be to create extensibility by making the development of custom data fields easier, and show you how to do so. It is good to reflect on how this entire process works, which is the essential piece of this article.

View Entire Article

User Comments

Title: A test title   
Name: Hassan
Date: 2008-06-30 10:37:25 AM
very good article.
Title: Awesome!   
Name: AzamSharp
Date: 2008-06-26 12:17:36 AM

Very nice article! I think I am going to look into creating some custom data field controls myself.
Title: Nice article   
Name: Joydip Kanjilal
Date: 2008-01-04 12:16:56 PM
Nice article Brian.



Author: ASP.NET Data Presentation Controls Essentials (Packt Publishing)

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-29 8:56:20 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search