c# - Sort gridview column with String.Format{0:C} -
i have gridview , sort perfect long don't change format. thus, changed format <%#string.format("{0:c}", eval("amount"))%> column , column doesn't sort proper anymore. suggestions appreciate. since sorts perfect when there no format currency maybe have idea of adding dollar sign without interfering sorting.
thank you!
try this
<asp:boundfield datafield="amount" headertext="amount" sortexpression="amount" />
for templatefield try like:
<asp:templatefield headertext="amount" sortexpression="amount"> <itemtemplate> <%#string.format("{0:c}",eval("amount"))%> </itemtemplate> </asp:templatefield>
Comments
Post a Comment