MsFlexGrid Control Array


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: MsFlexGrid Control Array

  1. #1
    Join Date
    Jan 2005
    Posts
    9

    Question MsFlexGrid Control Array

    Hi..

    I need to create a dynamic grid... i was told to use an array for the flexgrid. But I dunno how.

    I only put one grid in the form... but as the program run... i was to create a new one... based on the name selected in the combobox. So when I click the name on the combobox... the specified grid(index) will show... but so far I dont know how to create...

    in other words... i want to find out how to use MsFlexGrid Control Array

    can someone gimme a sample code to create new flexgrid...


    thanks..

  2. #2
    Join Date
    Dec 2004
    Location
    México DF
    Posts
    127
    I have never created MsFlexGrid Control arrays, but to load new controls at runtime, one possibility is, effectively, to use arrays:

    - create one control at design time
    - at deseign time, convert to an array by setting Index property to 0
    - at runtime load as many controls (belonging to the array) as desired, for example here I am using a cmbobox control:

    Load Me.cboSiNo(i)
    With Me.cboSiNo(i)
    .AddItem "Sí"
    .AddItem "No"
    .ListIndex = 0
    End with

    Hope this helps,

    mc

  3. #3
    Join Date
    Apr 2005
    Location
    Pasay & Candon City, I.S., Phils.
    Posts
    22
    I believe you wont have to use MsFlexGrid control array, you just have to re-load it with new data ed on the name selected in the combobox right? You could just clear the MsFlexGrid then use .additem to add new data into it....

  4. #4
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392
    If the "new" grid needs different columns and/or column headers, you can do it like this:

    Code:
    ' Wipe out everything
    MSFlexGrid1.Cols=1
    MSFlexGrid1.Rows=1
    
    ' Resize grid for new data
    MSFlexGrid1.Cols = intTotCols
    
    ' Set headers (assumed to be in an array)
    For X = 1 to intTotalCols
        MSFlexGrid1.TextMatrix(0,X-1) = aColHeader(X)
        ' NOTE: May want to set MSFlexGrid1.ColWidth(X-1) also...
    Next
    
    ' Load Data...
    Bob Rouse
    Dimension Data

  5. #5
    Join Date
    Jan 2005
    Posts
    9

    Thumbs up Problem no more

    Hey,

    thanks everyone... my proble is solved!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center