<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Smart red fox &#187; Firefox</title>
	<atom:link href="http://www.smartredfox.com/category/firefox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smartredfox.com</link>
	<description>Thoughts from the web and stuff</description>
	<lastBuildDate>Fri, 27 Aug 2010 13:01:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Image buttons in an Asp:datagrid for edit/cancel/update</title>
		<link>http://www.smartredfox.com/2009/03/image-buttons-in-an-aspdatagrid-for-editcancelupdate/</link>
		<comments>http://www.smartredfox.com/2009/03/image-buttons-in-an-aspdatagrid-for-editcancelupdate/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 14:45:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Uncategorised]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=128</guid>
		<description><![CDATA[Just recently I had to style an asp datagrid that another developer had created. Now almost all of our default styles for this site use simple image buttons for actions but the datagrid automatically pumps out the Edit, Cancel, and Delete buttons as plain text. Unfortunately Microsoft have given very little control to designers/developers over [...]]]></description>
			<content:encoded><![CDATA[<dl id="attachment_130" class="wp-caption alignright" style="width: 282px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-130 colorbox-128" title="Text buttons" src="http://www.smartredfox.com/wp-content/uploads/2009/03/nobuttons.png" alt="The Datagrid with text links." width="272" height="221" /></dt>
</dl>
<p>Just recently I had to style an asp datagrid that another developer had created. Now almost all of our default styles for this site use simple image buttons for actions but the datagrid automatically pumps out the Edit, Cancel, and Delete buttons as plain text. Unfortunately Microsoft have given very little control to designers/developers over what is pumped out onto the page, so it&#8217;s pretty much a link, or an input button as standard.</p>
<p>I had a brief look for a way around this and found lots of people with similar problems but no perfect way round this problem.</p>
<p>The simplest way I found around the problem is to put an image tag into the text attribute. E.g.:</p>
<p><span id="more-128"></span></p>
<p><span style="color: #999999;"><strong>&lt;asp:EditCommandColumn HeaderText=&#8221;Actions&#8221; ButtonType=&#8221;LinkButton&#8221; UpdateText=&#8221;<span style="color: #333399;">&lt;img src=&#8217;../images/buttons/small/updatesmall.png&#8217; alt=&#8217;Update&#8217; /&gt;</span>&#8221; CancelText=&#8221;<span style="color: #333399;">&lt;img src=&#8217;../images/buttons/small/cancelsmall.png&#8217; alt=&#8217;Cancel&#8217; /&gt;</span>&#8221; EditText=&#8221;<span style="color: #333399;">&lt;img src=&#8217;../images/buttons/small/editsmall.png&#8217; alt=&#8217;Edit&#8217; /&gt;</span>&#8220;&gt;&lt;/asp:EditCommandColumn&gt;</strong></span></p>
<p>This does work but it doesn&#8217;t have any hover effects on mouse over,  nor does it allow you to use <a href="http://www.alistapart.com/articles/sprites/" target="_blank">css sprites</a> to keep load times down. In this case it also meant that I&#8217;d have to create seperate images for every action.</p>
<p>So what I did instead was the following; I added an itemStyleCssClass attribute to the EditCommandColumn with my button style on it, then I put span&#8217;s into the text for Edit, Cancel, and Update that have a specific class for each button type:</p>
<p><span style="color: #999999;"><strong>&lt;asp:EditCommandColumn HeaderText=&#8221;Actions&#8221;<span style="color: #333399;"> ItemStyle-CssClass=&#8221;grey_small_circle&#8221;</span> ButtonType=&#8221;LinkButton&#8221; UpdateText=&#8221;<span style="color: #333399;">&lt;span class=&#8217;tick&#8217;&gt;Update&lt;/span&gt;</span>&#8221; CancelText=&#8221;<span style="color: #333399;">&lt;span class=&#8217;cancel&#8217;&gt;Cancel&lt;/span&gt;</span>&#8221; EditText=&#8221;<span style="color: #333399;">&lt;span class=&#8217;edit&#8217;&gt;Edit&lt;/span&gt;</span>&#8220;&gt;&lt;/asp:EditCommandColumn&gt;</strong></span></p>
<p>Then I added the following CSS:</p>
<pre class="brush: css">

/*Create buttons and add hover effect */

.grey_small_circle a{background:url(/admin/images/buttons/medium/grey_small_circle.png) no-repeat 0 0;display:block;line-height:30px;margin-top:1px;outline:none;width:31px}
.grey_small_circle a:hover,a:hover.grey_small_circle{background-position:0 -30px;color:#00affc;text-decoration:none}

/* Add the image inside */

.grey_small_circle span{background:transparent url(/images/icons/medium/all.png) no-repeat -288px -252px;display:block;height:30px;text-indent:-9000px;width:32px}

.grey_small_circle span.edit{background-position:-242px -201px}
.grey_small_circle span.redcross{background-position:-13px -252px}
.grey_small_circle span.remove{background-position:-427px -357px}
</pre>
<dl id="attachment_132" class="wp-caption alignleft" style="width: 369px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-132 colorbox-128" title="Datagrid with hover buttons." src="http://www.smartredfox.com/wp-content/uploads/2009/03/withbuttons.png" alt="Datagrid with hover buttons." width="359" height="284" /></dt>
</dl>
<p>This css adds the grey circle in the background of the buttons (see the screenshot) and makes the hover work using the <a href="http://www.alistapart.com/articles/slidingdoors/" target="_blank">sliding doors technique</a>.</p>
<p>I then use <a href="http://www.alistapart.com/articles/sprites/" target="_blank">css sprites</a> for putting an action image onto each button (using the class we assigned to the span), this technique speeds up load times and stops the unstyled pauses when a user hovers over a button. The last lines of the css attach a sheet of sprites  (in this case the excellent <a href="http://www.pinvoke.com/" target="_blank">PI Diagona icons from pinvoke</a>) and moves them depending on which button needs to be displayed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2009/03/image-buttons-in-an-aspdatagrid-for-editcancelupdate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing spaces below images in FF &amp; Safari</title>
		<link>http://www.smartredfox.com/2008/03/removing-spaces-below-images-in-ff-safari/</link>
		<comments>http://www.smartredfox.com/2008/03/removing-spaces-below-images-in-ff-safari/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 12:24:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=4</guid>
		<description><![CDATA[Here&#8217;s an annoying problem. A site renders perfectly in IE6 (this alone is surprising) but in Firefox2 and Safari it shows a 4px space below each image: Images naturally sit on the baseline. This means that they&#8217;re about 4px up from the bottom normally. Setting vertical-align: bottom or display:block seems to clear it. The solution [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an annoying problem. A site renders perfectly in IE6 (this alone is surprising)  but in Firefox2 and Safari it shows a 4px space below each image:</p>
<p>Images naturally sit on the baseline. This means that they&#8217;re about 4px up from the bottom normally. Setting vertical-align: bottom or display:block seems to clear it.</p>
<p>The solution for this was found <a href="http://archivist.incutio.com/viewlist/css-discuss/45493">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2008/03/removing-spaces-below-images-in-ff-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
