The following code implements custom sorting of fields by description, having fields without descriptions at the bottom.
private void queryBuilder1_CustomizeDatasourceFieldList(QueryBuilder queryBuilder, DataSource datasource, MetadataFieldList fieldList)
{
       fieldList.Sort(new SortFieldsByDescriptionComparer());
}

private class SortFieldsByDescriptionComparer: IComparer
{
       int IComparer.Compare(MetadataCollectionItemBase qn1, MetadataCollectionItemBase qn2)
       {
               MetadataField f1 = (MetadataField) qn1;
               MetadataField f2 = (MetadataField) qn2;

               int result = String.Compare(f1.ShortDescription, f2.ShortDescription, true);

               if (result == 0)
               {
                       result = String.Compare(f1.AltName, f2.AltName, true);

                       if (result == 0)
                       {
                               result = String.Compare(f1.NameStr, f2.NameStr, true);
                       }
               }
               return result;
       }
}

Is this article helpful for you?