About
Digital Colony is the technical web site for Michael Allen Smith of Seattle.
Tag Archives: GridView
Clear GridView Control in ASP.NET
Clearing a populated GridView control can be done in just 3 lines of code. Create an empty DataTable and then bind it to the Gridview. DataTable dt = new DataTable(); GridView1.DataSource = dt; GridView1.DataBind();
Quickly Populating a GridView With Dummy Data
Maybe the database table isn’t ready yet, but you’d like to start working on a new GridView. What you need is a quick and dirty way to load up a GridView control with sample data. Drop a GridView Control onto … Continue reading
Highlight Rows and Columns on GridView Control
Yesterday I stumbled upon Ryan Scherf’s Table Row and Column Highlighting. It’s a slick solution to helping users read tabular data. I thought it would be nice to add that functionality to the ASP.NET. So I created a single function … Continue reading
DataFormatString Not Working? Here is the Fix
If you have a GridView control and are are trying to data format a BoundField, you may find your format instructions are being ignored. The fix is to add HtmlEncode=”False” to the asp:BoundField. Then the DataFormatString should work. <asp:BoundField DataField=”LastModified” … Continue reading
