Solved

Populate Flexigrid

Posted on 2001-06-29
2
381 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 43
Error when passing an argument to a vb6 that contains  '/' 7 46
Add and format columns in vb6 7 72
Dinamic report to Crosstab query 9 52
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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