When using iif to handle dividing by zero in my calculated column I am always getting 0.
when I uses the expression iif({1},0,{0}) the column displays the value in the bound column Pagecount and if I use the expression iif({1},0,{1}) the column displays the value in the bound column Teampagecount, but when I put the 2 together I always get 0.
What could be the problem?
Here is the entire grid
<telerik:GridCalculatedColumn DataFields="Pagecount, Teampagecount" Expression="iif({1}=0,0,{0}/{1}*100)" HeaderText="Team Work Ratio" UniqueName="Teamratio" DataType="System.Decimal" ItemStyle-HorizontalAlign="Right" /> |
when I uses the expression iif({1},0,{0}) the column displays the value in the bound column Pagecount and if I use the expression iif({1},0,{1}) the column displays the value in the bound column Teampagecount, but when I put the 2 together I always get 0.
What could be the problem?
Here is the entire grid
<telerik:RadGrid ID="rgWorkload" runat="server" Skin="Sunset" Width="998px" Height="500px" |
AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" GridLines="None" |
PageSize="50" AutoGenerateColumns="False" ShowFooter="true"> |
<MasterTableView AllowMultiColumnSorting="true"> |
<FooterStyle Height="20px" /> |
<Columns> |
<telerik:GridBoundColumn DataField="User" HeaderText="Underwriter" UniqueName="User" |
DataType="System.String" Aggregate="Count" /> |
<telerik:GridBoundColumn DataField="Teamname" HeaderText="Primary Team" UniqueName="Teamname" |
DataType="System.Int32" /> |
<telerik:GridBoundColumn DataField="Mas" HeaderText="MAS" UniqueName="Mas" DataType="System.String" /> |
<telerik:GridBoundColumn DataField="Casecount" HeaderText="Pending Cases" UniqueName="Casecount" |
DataType="System.Int32" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" /> |
<telerik:GridBoundColumn DataField="Doccount" HeaderText="Pending Documents" UniqueName="Doccount" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" /> |
<telerik:GridBoundColumn DataField="Pagecount" HeaderText="Pending Pages" UniqueName="Pagecount" |
DataType="System.Int32" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" /> |
<telerik:GridBoundColumn DataField="Dupcount" HeaderText="Cases with Possible Dups" |
UniqueName="Dupcount" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" |
Aggregate="Sum" /> |
<telerik:GridCalculatedColumn DataFields="Pagecount, Teampagecount" Expression="iif({1}=0,0,{0}/{1}*100)" |
HeaderText="Team Work Ratio" UniqueName="Teamratio" DataType="System.Decimal" |
ItemStyle-HorizontalAlign="Right" Aggregate="Avg" FooterAggregateFormatString="Mean: {0:0.00}" /> |
<telerik:GridCalculatedColumn DataFields="Pagecount, Overallpagecount" Expression="iif({1}=0,0,{0}/{1}*100)" |
HeaderText="Overall Work Ratio" UniqueName="Overallratio" DataType="System.Decimal" |
ItemStyle-HorizontalAlign="Right" Aggregate="Avg" FooterAggregateFormatString="Mean: {0:0.00}" /> |
<telerik:GridBoundColumn DataField="Compcasecount" HeaderText="Completed Cases(24hrs)" |
UniqueName="Compcasecount" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" |
Aggregate="Sum" /> |
<telerik:GridBoundColumn DataField="Teampagecount" HeaderText="Team Pages" UniqueName="Teampagecount" |
DataType="System.Int32" ItemStyle-HorizontalAlign="Right" /> |
<telerik:GridBoundColumn DataField="Overallpagecount" HeaderText="Overall Pages" UniqueName="Overallpagecount" |
DataType="System.Int32" ItemStyle-HorizontalAlign="Right" /> |
</Columns> |
</MasterTableView> |
<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"> |
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" /> |
<Resizing AllowColumnResize="true" EnableRealTimeResize="true" ClipCellContentOnResize="false" /> |
</ClientSettings> |
</telerik:RadGrid> |