development blog for the wicked stuff we encounter

I use Asp.Net DynamicData frequently, because it really speeds up development in a confortable way for some kind of projects. I'm using the DynamicData Futures July edition, and it has beautiful features like Ajax enabled DateTime UI, custom Where clauses, and Insert parameters etc. But it has some GUI design flaws: 1) the Child relations' text occupies way too much space, and makes it unreadable I've added some simple PNGs from the WebAppers Icon Set to make it more vivid for the end user. Download the icon set, and select the icons you like. The template files can be found under ~/DynamicData/FieldTemplates/ The Child relations file is named Children.aspx,  the codebehind file is Children.aspx.cs. In the Page_Load event of the codebehind, i simply commented out the name setting of the child table, because it's already in the Table header:
        protected void Page_Load(object sender, EventArgs e) {
            //HyperLink1.Text = "View " +ChildrenColumn.ChildTable.GetDisplayName();
            //InsertHyperLink.Text = "Insert " +ChildrenColumn.ChildTable.GetDisplayName();
and in the aspx file, I've added the icons, and removed the two objects referred in the aspx.cs:


Back in the codebehind file, you need to replace the reference to HyperLink1 to InsertLink:
        public override Control DataControl {
            get {
                //return HyperLink1;
                return InsertLink;
Build, and see in action: dinamicdatawithicons1 You can do it with ForeignKeys as well - I choose the Next type icon for the outer reference. 2) the GridView controls are missing the GridViewAlternateRows settings Simply do a text search for "asp:GridView", and add AlternatingRowStyle-CssClass="even" to every occurence. If you finished, create a new CSS class in ~/Site.css:
.even {
    background-color:#eeeeee !important;
    background: #eeeeee  !important;
This will work in every major browsers :)