Wednesday, November 19, 2014

DevExpress WinForms GridView RepositoryItemButtonEdit Glyph - image not showing

Glad I spent the last couple of hours tracking this down.

If you've set your ButtonEdit's button to Kind = Glyph and assigned it an Image and the image still doesn't show - you need to set the ButtonEdit's TextEditStyle to HideTextEditor. If you use DisableTextEditor, the button won't show.

Brilliant, really. The button and image have nothing to do with the text editor, but changing the text edit style makes a difference.

Thursday, March 17, 2011

Attribute only valid on v:image

Ran into an error in IE6 on a site I was developing:

"Attribute only valid on v:image"

The error message popped up on a Google Map canvas I had embedded in the page whenever a user interacted with the map.

The culprit was a combination of DD_belatedpng and a rule included by default in html5boilerplate where all tags were being fixed by DD_belatedpng when the page loaded. Removing the img selector from this rule resolved the error.

Tuesday, August 25, 2009

FusionCharts, IE6, and "Unknown runtime error"

FusionCharts' JavaScript file makes use of innerHTML to replace a placeholder <div>'s content with the generated SWF. However, on IE6, this causes an "Unknown runtime error".

I am working with version 1.2.4. I have jQuery 1.3 loaded on the site, so I replaced four instances of innerHTML calls with $().html() syntax:

Line 237:
{ n.innerHTML = obj.getSWFHTML(); },false );
became
{ $(n).html(obj.getSWFHTML()); }, false);

Line 242:
{ n.innerHTML = obj.getSWFHTML(); } );
became
{ $(n).html(obj.getSWFHTML()); });

Line 246:
n.innerHTML = this.getSWFHTML();
became
$(n).html(this.getSWFHTML());

Line 251:
n.innerHTML = this.getSWFHTML();
became
$(n).html(this.getSWFHTML());

Saturday, July 25, 2009

jQuery execution after image load

If you need to run JavaScript that's based on some attribute of a loaded image (e.g. height or width), use a callback with $(window).load() instead of $(document).ready().

Friday, June 5, 2009

Pure T-SQL (Geo) Distance Calculations

Awesome post by Joe Finsterwald (http://www.wtfdeveloper.com/Default2.aspx) shows how to implement geographical distance calculation functionality in pure T-SQL.

Monday, April 27, 2009

T-SQL Epoch Date Conversion

I needed a way to convert a BIGINT containing a date in SSE (seconds since epoch - 1/1/1970) format into a DATETIME. The following query does the trick:

SELECT DATEADD(DAY, CAST(sse_value AS BIGINT)/86400000, CAST('19700101' AS DATETIME))

Thanks to some guy named Steve Kass for pointing this out on DevelopmentNow.

Saturday, April 11, 2009

Safari color issues?

If you're experiencing color issues with your images in Safari, make sure that an embedded color profile was not saved with the image. Open the image in Photoshop; File --> Save As; uncheck Embed Color Profile; save image.