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!
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL