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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -