MsFlexGrid Control Array
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...
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:
.ListIndex = 0
Hope this helps,
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....
If the "new" grid needs different columns and/or column headers, you can do it like this:
' Wipe out everything
' 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...
' Load Data...
Problem no more
thanks everyone... my proble is solved!
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center