Datagrid info

N

Newbie

Having seen in the past lots of questions re: the datagrid control and not
being able to find any answers I thought I would share what I have been able
to do:

To set the datasource for the datagrid use the following:

(having already created a recordset - rs)

Set me.mydatagrid.DataSource = rs

To format the Grid from code (assuming 2 columns in the recordset)

Dim col1, col2 as column
set col1 = me.mydatagrid.columns(0)
set col2 = me.mydatagrid.columns(1)

me.mydatagrid.font.name = "Arial"
me.mydatagrid.font.size = 10
me.mydatagrid.headfont.name = "Arial"
me.mydatagrid.headfont.bold = true

col1.width = 2000
col2.width = 1000

col1.caption = "My Column"
col2.caption = "Your Column"

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top