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


. 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