title: How to do sorting of field using DevExpress ASPxGridView
body: <p>I have a Field Amount which should display curreny+ Amount. Since, I am not able to provide fieldName with '$'200 I have set the field as unbound. Sorting happens but the data populated is not correct. I have amount ranging from 40 to 500. But while sorting the descending order display 100 and ascending order displays 99.9
  Kindly help to solve this issue.</p>
  
  <p>//Designer</p>
  
  <pre><code>  &lt;dx:ASPxGridView ID="gridReports" runat="server" Width="100%" KeyFieldName="SID" ClientInstanceName="gridReports" 
  onpageindexchanged="gridReports_PageIndexChanged" onrowcommand="gridReports_RowCommand" AutoGenerateColumns="False" oncustomunboundcolumndata="gridReports_CustomUnboundColumnData" oncustomcolumndisplaytext="gridReports_CustomColumnDisplayText"&gt;
   &lt;SettingsBehavior EnableRowHotTrack="true" /&gt; &lt;SettingsPager AlwaysShowPager="true" Position="Bottom" PageSize="25" /&gt; 
  &lt;Columns&gt; 
  &lt;dx:GridViewDataColumn CellStyle-HorizontalAlign="right" Width="24%" Caption="AMOUNT" VisibleIndex="5" UnboundType="Decimal" FieldName="ForeName" Settings-SortMode="Value"&gt;
   &lt;/Columns&gt; 
  &lt;SettingsBehavior ConfirmDelete="True" /&gt; &lt;SettingsBehavior ConfirmDelete="True" EnableRowHotTrack="True" /&gt; &lt;SettingsPager AlwaysShowPager="True" PageSize="25"&gt; &lt;/SettingsPager&gt;
  </code></pre>
  
  <p></p>
  
  <p>//Code</p>
  
  <pre><code>  protected void gridReports_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
          {
              if (e.Column.FieldName == "ForeName")
              {
                  string currency = (string)e.GetListSourceFieldValue("DEFAULT_CURRENCY");
                  string amount = (string)e.GetListSourceFieldValue("AMOUNT");
                  e.Value = GTYPE(currency) + amount;  
  
              }
          }
  </code></pre>
  
  <p>Please not that I have given value and displayText in 'gridReports_CustomColumnDisplayText' but sorting didnot take place.I had changed UnboundType to Integer and decimal also.</p>
  
  <p>Tried this method also:</p>
  
  <pre><code>protected void gridReports_CustomColumnDisplayText(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDisplayTextEventArgs e)
          {
              if (e.Column.FieldName == "ForeName")
              {
                  object currency = e.GetFieldValue("DEFAULT_CURRENCY");
                  object amount = e.GetFieldValue("AMOUNT");
                  e.DisplayText = ((string)GTYPE(currency.ToString()) + amount);
                  e.Value = Decimal.Parse(amount.ToString());
  
  
              }
          }
  </code></pre>