Thank you,
Michael
public
void dgReport_ItemDataBound(Object sender, DataGridItemEventArgs e){
const int WHAT_COL = 0; const int PTD_COL = 1;TableCell cell =
null;TableCell cellPtd =
null; string ptd = "0"; if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)){
cell = (TableCell)(e.Item.Controls[WHAT_COL]);
if ((cell.Text == "COMMISSIONS") || (cell.Text == "EXPENSES") || (cell.Text == "TOTAL EXPENSES")){
cell.Font.Bold =
true;cellPtd = (TableCell)(e.Item.Controls[PTD_COL]);
cellPtd.Text = "";
}
else if (cell.Text == "NET INCOME"){
cellPtd = (TableCell)(e.Item.Controls[PTD_COL]);
ptd = cellPtd.Text;
cellPtd.Text = String.Format("{0:c}", Convert.ToDouble(ptd));
}
else{
cellPtd = (TableCell)(e.Item.Controls[PTD_COL]);
ptd = cellPtd.Text;
cellPtd.Text = String.Format("{0:#,##0.00}", Convert.ToDouble(ptd));
}
}
}
Replies
Know the answer? Post it — somebody with the same question will find it here.