Menu

can ApplySort parameter a little simple?

2005-08-30
2013-03-07
  • yangjunfeng

    yangjunfeng - 2005-08-30

    ApplySort take a PropertyDescripter parameter which is complex to get,
    can it using string parameter?

     
    • Martijn Boland

      Martijn Boland - 2005-08-30

      Yes, a string parameter is possible. In fact, it is already there but for some reason it is not in CVS. I'll have a look at it tonight when I'm home.

       
    • yangjunfeng

      yangjunfeng - 2005-08-30

      have or not isn't series, but simple.thanks

       
    • Martijn Boland

      Martijn Boland - 2005-09-01

      It's in CVS now.

       
    • yangjunfeng

      yangjunfeng - 2005-09-02

      /// <param name="alias">The alias for the column (display name).</param>
      public ObjectViewColumn Add(string propertyName, string alias)
      this.orderObjectView.Columns.Add("OrderId", "Order number");
      ==============================
      alias seems to be internationalized as display name. why not use propertyName? thanks.

       
    • Martijn Boland

      Martijn Boland - 2005-09-03

      I'd also rather use the property name for these things. Problem only is that it has to map to the name of the PropertyDescriptor. That should still be fine, since the PropertyDescriptor has a Name and a DisplayName property, but for some reason the DisplayName is not used by UI controls.
      To show friendly names in grid headers we have to set the alias as the name of the PropertyDescriptor.

       
    • Jake

      Jake - 2005-09-08

      Is there a way to sort on Multiple properties similar to the DV.Sort = "COL1 DESC, COL2 DESC"?

       
      • Martijn Boland

        Martijn Boland - 2005-09-09

        No, I don't think so.

         
    • Jake

      Jake - 2005-09-09

      I've added support for sorts on Multiple Properties; via OV.Sort = "Prop1 Desc,Prop2". It works great for me, but would love a second pair of eyes.

      Who should I send the code to?

       
    • Jake

      Jake - 2005-09-09

      I've uploaded the files into the patches section.

       
    • Martijn Boland

      Martijn Boland - 2005-09-12

      I'll have a look at it. The goal is to stay as close to the DataView as possible.

      One question though: wouldn't it be much more efficient to do sorting on multiple fields with queries? I think the ApplySort() method is specifically designed for interacting with UI controls.

       
    • Jake

      Jake - 2005-09-12

      DataView has a Sort property which allows sorting on multiple items, so I thought I was just adding something that DataView offered.

      The system I'm working on always caches the DataSet or DataTable. This has proven to be more effient then re-running the query. Doing the sort in the view means that we don't have to go to the DB just for a sort on the data.

       
      • Martijn Boland

        Martijn Boland - 2005-09-13

        Ah well, that indeed makes sense.

         

Log in to post a comment.

MongoDB Logo MongoDB