Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
How to associate an UltraGrid field with a group
posted

Hi all, I'm wondering if someone can tell me how to dynamically associate a field in an UltraGrid with a group defined in the UltraGrid?

I am using Progress OpenEdge 11.2 with the 11.2.20112.2124 version of the control, and I can add the group and fields to the group at design time using the UltraGrid designer.  But I'd like to be able to do this at runtime, so that I can associate the fields to different groups.  Does anyone know if this is possible?  I can create the groups dynamically, but how can fields be added to them?

Thanks,

Paul.

Parents
  • 29105
    Suggested Answer
    Offline posted

    Hello Paul,

    The Groups collection off of the UltraGridBand exposes an Columns.Add you can use to add columns.

    Like so,

      
      UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
      UltraGridGroup group1 = null;      

      // Add group   
      group1 = band.Groups.Add( "Group1", "Contacts" );   


      // Add column "ContactName" to the first level (level 0) of group1 with visible 
      // position of 0 (meaning it will appear first in that level.)

       group1.Columns.Add( band.Columns["ContactName"],   0,   0 );

      // Add City column to second level (level 1) with visible position of 0. 

       group1.Columns.Add( band.Columns["City"],   0,   1 );

      Let me know if you have any questions regarding this matter.

Reply Children