Friday, May 20, 2011

Float Sorting Problem in GridView

Requirement : Display a float value in the format XXXX.XX. Also it must be formatted.

If we format this numer in SQL and return a formatted string, we lose the sorting functionality.
e.g nos will be displayed as

1.0
21.22
3.12

. To get correct result, return float as it is from SP and use DataFormatString="{0:F2}" in the
boundcolumn declaration in the gridview

No comments:

Post a Comment

 using Microsoft.AspNetCore.Mvc; using System.Xml.Linq; using System.Xml.XPath; //<table class="common-table medium js-table js-stre...