Solved

Populate Flexigrid

Posted on 2001-06-29
2
390 Views
Last Modified: 2008-02-01
I need to link a flexigrid to a datasource. has anyone got example code on how to do this?
0
Comment
Question by:krisjob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Expert Comment

by:hes
ID: 6239547
0
 
LVL 1

Accepted Solution

by:
edwinson earned 100 total points
ID: 6239560
Let's assume for the moment you have an ADO recordset. The included code gives you an example of how to connect a MSHflexgrid to an ADO recordset.
 
'First I set the fixed columns on my grid so the new
'data initially won't have a column of grayed out data
flxPerfTable.FixedCols = 0

'flxPerfTable - name of the MSHflexgrid
'rstPerf      - name of an ADO recordset containing
'               the desired data.
'
'next I use the set function of the flexgrid to assign
'a clone of a recordset to the grid. This loads the grid
'with the data.
'Basically you create a copy of the reference
'to the recordset.
Set flxPerfTable.DataSource = rstPerf.Clone

'Alternatively you can sometimes use
set flxPerfTable.DataSource = rstPerf

'In my code I have a column of record ID numbers that I
'want to be shaded gray so I reset the fixed columns to 1
flxPerfTable.FixedCols = 1


While this may get the data displayed in the grid you may want to do some additional formatting of column widths etc. to make sure the data can be viewed by your users in a way that makes sense.  Watch for data formatting as the flexgrid primarily handles text, so some data looks goofy when shown in the grid. In these cases you may need to modify the formatting of the data in the ADO prior to display. Experiment a bit.

Now if you haven't created an ADO recordset yet, you will need to do this as well before running the code above.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question