k its fine but the data is coming through database its not a bound fiels or custom field
I suppose, u have set autogeneratecolumns to true for gridview... so u dont have columns defined using boundcolumn or templatecolumn...
u can create RowDataBound event of gridview (select gridview and go to properties window... navigate to event section and doubleclick on RowDataBound event)
kedarrkulkar...
All-Star
34225 Points
5494 Posts
Re: Thousand Seperator in Grid view
Apr 13, 2012 10:46 AM|LINK
I suppose, u have set autogeneratecolumns to true for gridview... so u dont have columns defined using boundcolumn or templatecolumn...
u can create RowDataBound event of gridview (select gridview and go to properties window... navigate to event section and doubleclick on RowDataBound event)
define event as this
protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[1].Text = Strings.Format(Convert.ToDecimal(e.Row.Cells[1].Text), "#,##0.00"); } }considering second column (index 1) need to be formatted i have used Cells[1] in above code... replace index value based on column sequence number
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site