DevExpress gridview display format strings

I had a real nightmare trying to get the DevExpress (dxwgv:ASPxGridView) grid  to display data using a simple format string. After not getting a good response from their support team (which is pretty unusual as they are normally very good) I figured it out for myself – and it was really simple!

There is a “PropertiesTextEdit” property for each datagrid column type. This has an attribute of “DisplayFormatString” and that’s where you put your format string!

So for example:

<dxwgv:GridViewDataTextColumn Caption="Distance in miles"  FieldName="DistanceFromPostcode" >
        <PropertiesTextEdit DisplayFormatString="{0:F2}" />