Monday, May 21, 2007

ASP.net DataGrid

Grew my brain a bit on the ASP.net datagrid this past weekend while working on the upcoming web site www.smartmoneycredit.org. It's very interesting how many things can be done declaratively, though still having to do some lifting in the code. It may be due to my limitations, or the fact that the site is still in .net 1.1.

Had to do through code:
  • Assigning a CSS class based on the contents of a row, certain columns being present or empty
  • Using a complex function to determine the text of a cell
  • turning the visibility of a control on or off

For now, I'm living with it, there are just 1 or 2 pages that have some messy Item_DataBound event handlers. In the future, I might write something of a 'UI Helper' Layer that grabs business objects and applies some parsing and formatting to get the data into a UI friendly state. At least enough that a web page can handle it declaratively, and/or have better hints as to what styles to use.

Documentation I keep turning to are the articles on the 4 guys from rolla site (http://aspnet.4guysfromrolla.com/articles/040502-1.aspx)
by Scott Mitchell. I saw him present a few years ago in San Diego at the Beginner's .net user group. It was (appropriately) a very basic presentation. It wasn't until the past year or so that I discovered some of his information to be very in-depth and developed a better appreciation.

No comments: