Points: 6650

3/31/2015 10:21:43 AM

Inserting a row at the top of a datatable

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

When I populate dropdownlists, I frequently want to add a new row at the top. I've figured out that you can easily add one at the bottom with DataTable.Rows.Add(), but that's... not elegant. This article is just a few lines of code that shows how to add one at the top.

Why bother blogging such a simple piece of code?


I want to code quickly and efficiently and I can do that best if I have all the code samples that I needs at my fingertips instead of having to wade through endless blog entries. (some of which are innacurate)

Are you using the menus? Any subjects we can add? Tutorials

Version: Unknown or N/A
Section: .NET Development
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables