Thousand Seperator in Grid viewhttp://forums.asp.net/t/1792515.aspx/1?Thousand+Seperator+in+Grid+viewFri, 13 Apr 2012 11:26:51 -040017925154930813http://forums.asp.net/p/1792515/4930813.aspx/1?Thousand+Seperator+in+Grid+viewThousand Seperator in Grid view <p>how to get Thousand seperator in Gridview columns when the column is a number either any type</p> 2012-04-13T10:06:56-04:004930835http://forums.asp.net/p/1792515/4930835.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>&lt;asp:BoundField DataField=&quot;YourFieldId&quot; HeaderText=&quot;...&quot; DataFormatString=&quot;{0:0,0.0}&quot; /&gt;</p> 2012-04-13T10:16:11-04:004930836http://forums.asp.net/p/1792515/4930836.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>if it is boundfield... then try using dataformatstring</p> <p>&lt;asp:boundfield datafield=&quot;ColumnName&quot; <strong>dataformatstring=&quot;{0:N}&quot; </strong> /&gt;</p> <p>hope this helps...</p> 2012-04-13T10:16:26-04:004930858http://forums.asp.net/p/1792515/4930858.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>k its fine but the data is coming through database its not a bound fiels or custom field</p> 2012-04-13T10:27:18-04:004930861http://forums.asp.net/p/1792515/4930861.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>You would normally use something like {0:#.##} when formatting data.</p> 2012-04-13T10:28:18-04:004930882http://forums.asp.net/p/1792515/4930882.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>which place did i use this after databind() method</p> 2012-04-13T10:37:16-04:004930899http://forums.asp.net/p/1792515/4930899.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p></p> <blockquote><span class="icon-blockquote"></span> <h4>suribabuk</h4> <p></p> <p>k its fine but the data is coming through database its not a bound fiels or custom field</p> <p></p> </blockquote> <p></p> <p>I suppose, u have set autogeneratecolumns to true for gridview... so u dont have columns defined using boundcolumn or templatecolumn...</p> <p>u can create RowDataBound event of gridview (select gridview and go to properties window... navigate to event section and doubleclick on RowDataBound event)</p> <p>define event as this</p> <pre class="prettyprint">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), &quot;#,##0.00&quot;); } }</pre> <p></p> <p>considering second column (index 1) need to be formatted i have used Cells[1] in above code... replace index value based&nbsp;on column sequence number&nbsp;</p> <p>hope this helps...</p> 2012-04-13T10:46:25-04:004930920http://forums.asp.net/p/1792515/4930920.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>thank u very much but i am using devexpress gridview its not have a rowdatabound event its only have databound event is it similar or different</p> 2012-04-13T10:59:36-04:004930950http://forums.asp.net/p/1792515/4930950.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>is it ASPxGridView? i think u can use HtmlDataCellPrepared event then</p> <p>check the HtmlDataCellPrepared&nbsp;event in this link</p> <p><a href="http://www.devexpress.com/Support/Center/e/E84.aspx">http://www.devexpress.com/Support/Center/e/E84.aspx</a></p> <p>the syntax for formatting the value should remain same</p> <p>hope this helps...</p> 2012-04-13T11:14:42-04:004930982http://forums.asp.net/p/1792515/4930982.aspx/1?Re+Thousand+Seperator+in+Grid+viewRe: Thousand Seperator in Grid view <p>Thank u very much i will check it</p> <p>&nbsp;</p> 2012-04-13T11:26:51-04:00