Building a Full-Featured Custom DataGrid Control

A Look Ahead

Just so we know our objective, I will quickly illustrate what we expect our page results to look like once we are done. To peer ahead, after reading this article, you will be able to create a search form page utilizing a custom datagrid control that includes paging, results display, and most importantly caching, that will look like this:

All from a Datagrid server control tag that looks like this:

<DMGrid:myCustDG ID="MyDataGrid" runat="server" autoCols="true" bgClr="Red" frClr="White" />

Pretty awesome! Incidentally, I had written an article covering data caching, and demonstrated a Cached Datagrid utilizing almost identical techniques discussed here. Be sure to read .NET Data Caching, Custom ASP.NET Datagrid Paging With Exact Count and Drilldown Datagrid Searching with ASP.NET for all the methods and techniques discussed here.

Therefore, before reading this article, take the time to download the source code, compile it and see it in action. See the results, then do a few custom modifications, recompile it, then view the result of your own modifications. By doing so, you should have no problem grasping the advanced techniques discussed and presented here, or with the how in creating your own customizations.

The manner in which this example is demonstrated (as a full search page) is just the way I happen to do it. There's a lot going on here, which is the reason why I want you to have a run through the code, and get a good idea of what's going on. This way, our objective in examining how easy a custom datagrid control can be created, and how easy your own customizations can be applied, is accomplished. So with all this in mind, let's begin by looking at everything taking place, from the top.

You might also like...

Comments

About the author

Dimitrios Markatos

Dimitrios Markatos United States

Dimitrios, or Jimmy as his friends call him, is a .NET developer/architect who specializes in Microsoft Technologies for creating high-performance and scalable data-driven enterprise Web and des...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I invented the term Object-Oriented, and I can tell you I did not have C++ in mind.” - Alan Kay