Hi, This is what I was able to format the amount field displaying currency ,but when I got to edit mode, the formating is not there. so what event I can do the formating , I appreciate a snippet of the code to format in edit mode. thanks Bob protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { foreach (TableCell tc in e.Row.Cells) { DataColumn dc = ((DataRowView)e.Row.DataItem).Row.Table.Columns[((DataControlFieldCell)tc).ContainingField.HeaderText]; if (dc != null) { if (dc.DataType == typeof(decimal)) { tc.HorizontalAlign = HorizontalAlign.Right; tc.Text = Decimal.Parse(tc.Text).ToString("C"); } } } } }// end of method
↧
how to format amount field in gridview in edit mode
↧