Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i set column width and height for the datagrid ?
[Image: 2007-02-28_143357.jpg]

here is my current code:
Copy      Help
function# hDlg message wParam lParam

;typelib MSDataListLib {F0D2F211-CCB0-11D0-A316-00AA00688B10} 1.0
;typelib MSFlexGridLib {5E9E78A0-531B-11CF-91F6-C2863C385E30} 1.0

typelib MSDataGridLib {CDE57A40-8B86-11D0-B3C6-00A0C90AEA82} 1.0

if(hDlg) goto messages
if(!ShowDialog("msdatagrid_dialog" &msdatagrid_dialog)) ret

;0 "" 0x10CF0A44 0x100 0 0 421 313 "datagrid"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;4 ActiveX 0x54000000 0x0 12 4 248 101 "MSDataGridLib.DataGrid"
;DIALOG EDITOR: "" 0x2020002 "" ""

sel message
,Database db4.Open(db4.CsAccess("C:\Programme\Microsoft Visual Studio\MyProjects\vbFlexdata-example\mydatabase2.mdb"))
,ADO.Recordset rs4; ARRAY(str) a4
,db4.QueryRs("SELECT * FROM friends" rs4)
,db4.RsGetAll(rs4 a4)
,MSDataGridLib.DataGrid da4._getcontrol(id(4 hDlg))


,DT_Init(hDlg lParam)
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,;case WM_DROPFILES mes _s
,case WM_COMMAND goto messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1

second question:
how to fill a datalist with custom values (not recordset) ?
do you recommend another component (code will be compiled as exe).

i think it's in this line.

4 ActiveX 0x54000000 0x0 12 4 248 101 "MSDataGridLib.DataGrid"

i think the 248 is the width; just make it bigger...maybe.
A new blog on QM coding and automation.

The Macro Hook
Use this before populating

Copy      Help

or this after
Copy      Help

I don't know what is the measurement unit. Tried to use twips (pixels*15) but it is too small. Pixels*26 is OK.
Cannot answer to other questions. Tried rs4._create, but says it must be opened. Tried to add rows using AddNew but it succeeds only for first column. The same error pops up if I try to edit cells manually.
... because data type was incorrect.

When recordset is opened from database (like in your code), to add new data can be used this:

Copy      Help
,int i
,for(i 0 5)

To set current row, use Move, MoveFirst, etc.
for some strange reason my installed version of MSDATGRD.OCX
caused the size problem (6.01.9782).
with the version from my vsstudio 6 cd it is correct (
i try to use DataFormat in the datagrid, because some columns show prices.

qm says 'expecting IDataFormatDisp'. :?:

in my vb6 test project its:

Copy      Help
BeginProperty Column01
         DataField       =   "EK"
         Caption         =   "EK"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   1
            Format          =   """€"" #.##0,00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1031
            SubFormatType   =   2

2. regarding datasource
i found this thread ->Using DataGrid Without DataSet (unbound)

Quote:A DataGrid's DataSource will accept any object which implements
IEnumerable (such as an Array or ArrayList), so a simple array of your
objects would be the simplest. Map columns to the properties you want

what is the DataSet the poster in posting #3 is writing about.

thanks a lot (like ever)
Copy      Help
,typelib StdFormat {6B263850-900B-11D0-9484-00A0C91110ED} 1.0
,StdFormat.StdDataFormat fm._create
,fm.Format="''€'' #.##0,00"
,;VARIANT v; v="Yess"; fm.TrueValue=&v ;;some properties require variable
Quote:what is the DataSet the poster in posting #3 is writing about.

Don't know. Also don't know what is IEnumerable.

Forum Jump:

Users browsing this thread: 1 Guest(s)