Hi
could you tell me how to format a numeric column in a grid as blank if the value is zero please. i have tried various formats like below but it only seems to like
simple formats like n4, n0 etc. im sure there must be some way but i cant figure it out
<ej:Grid ID="ClockingGrid" runat="server" Width="1100px" SelectionMode="Single"
OnServerCommandButtonClick="ClockingGrid_ServerCommandButtonClick"
AllowSorting="True" AllowPaging="True" IsResponsive="true">
<ClientSideEvents>
</ClientSideEvents>
<Columns>
<ej:Column Field ="ClockingID" HeaderText="ID" Width="75" TextAlign="Right" IsPrimaryKey="True" />
<ej:Column Field ="Date" HeaderText="Date" Width="160" TextAlign="Right" Format="{0:ddd dd/MM/yy HH:mm:ss}" />
<ej:Column Field ="ClockingType" HeaderText="T" Width="40" TextAlign="Center"/>
<ej:Column Field ="DeviceID" HeaderText="Dev" Width="65" TextAlign="Right" />
<ej:Column Field ="JobCode" HeaderText="Job" Width="75" TextAlign="Right" Format="{0:0;;}"/>
<ej:Column Field ="Latitude" HeaderText="Lat" Width="75" TextAlign="Right" Format="{0:n4}" />
<ej:Column Field ="Longitude" HeaderText="Lon" Width="75" TextAlign="Right" Format="{0:n4}" />
<ej:Column Field ="Accuracy" HeaderText="Acc" Width="60" TextAlign="Right" Format="{0:n0}" />
<ej:Column Field ="Address" HeaderText="Address" Width="250" TextAlign="Left" />
<ej:Column HeaderText="G" TextAlign="Left" Width="37" CssClass="btncolstyle" HeaderTextAlign="Center" AllowSorting="false" >
<Command>
<ej:Commands Type="edit" >
<ButtonOptions Width="24" Height="24" ImagePosition="ImageLeft" ContentType="TextOnly"
ShowRoundedCorner="true" Text="" CssClass="btngeocode">
</ButtonOptions>
</ej:Commands>
</Command>
</ej:Column>
<ej:Column Field ="JobHours" HeaderText="Job Hr" Width="65" TextAlign="Right" Format="{0:n2}"/>
<ej:Column Field ="TAAHours" HeaderText="TAA Hr" Width="65" TextAlign="Right" Format="{0:n2}"/>
</Columns>
<PageSettings PageSize="18" />
</ej:Grid>
FYI: this is a simple method in my code library that i have that works for general formatting of an integer
public static string BlankIfZero(int myInt)
{
return string.Format("{0:0;-0;\"\"}", myInt);
}
thanks
Bob