My Opera is closing 3rd of March

knowledge, skill, experience ... about IT, computer, programming ...

Kiến thức tạo nên sức mạnh, năng lực đạp đổ bằng cấp...!

How to shown format number like this {###,###.##} in GridView?

<asp:BoundField DataField="DOB" HeaderText="Date Of Birth" HtmlEncode="False" DataFormatString="{0:d}" />

And then implement the backend code like below:(Code VB.NET)
protected void OnRowDataBound(object sender, EventArgs e)
{
     GridViewRowEventArgs ea = e as GridViewRowEventArgs;
     if (ea.Row.RowType == DataControlRowType.DataRow)
     {
         DataRowView drv = ea.Row.DataItem as DataRowView;
         Object ob = drv["Phone"];
         if (!Convert.IsDBNull(ob))
         {
             Int64 iParsedValue = 0;
             if (Int64.TryParse(ob.ToString(), out iParsedValue))
             {

                 TableCell cell = ea.Row.Cells[4];
                 cell.Text = String.Format(System.Globalization.CultureInfo.CurrentCulture,
                    "{0:(###) ###-####}", new object[] { iParsedValue });
             }
         }
     }
}

Formatting Grid View - Change appearance of rowsTracking & Displaying Sessions/Visitors Online

Write a comment

New comments have been disabled for this post.

February 2014
S M T W T F S
January 2014March 2014
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28