Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids 101
Message
From
06/11/2003 03:34:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/11/2003 16:33:48
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00846808
Message ID:
00846952
Views:
22
>Hi All:
>
>I've started dabbling with a grid and I just need some help to get me up to speed.
>
>I want a simple form that'll create a cursor of filenames, populate a grid with the list and have the user click a check box in the grid next to any filename he wants to do an action on (the action itself is not important here, probably).
>
>So I created a form, dropped a grid with the followng attributes:
>
>
>
>recordtype=alias (I also tried 'table')
>recordsource = CURS_MATRIX
>
>
>I then set up two methods in the form
>
>
>INIT
>DODEFAULT()
>thisform.CreateMatrixCursor()
>thisform.grdMatrix.Refresh()
>
>CREATEMATRIXCURSOR
>ADIR(laMatrix,'c:\agri\poult\excel spreadsheets\agri????.xls')
>
>CREATE CURSOR CURS_MATRIX (cu_fname c (15))
>
>APPEND FROM ARRAY laMatrix
>
>ALTER table CURS_MATRIX ADD cu_lupd L
>
>
>Nothing appears in the grid!
>
>I'm probably doing something real stupid, but if I don't ask, I won't know.
>
>Thanks a lot.
>
>Yossi

Yossi,
You could do all in grid.init. ie :
oForm = Createobject('MyForm')
oForm.Show
Read Events

Define Class myForm As Form
  Add Object myGrid As Grid

  Procedure myGrid.Init
  Local Array laMatrix[1]
  ADIR(laMatrix,'c:\agri\poult\excel spreadsheets\agri????.xls')
  Create Cursor CURS_MATRIX (cu_fname c (15), cu_lupd L)
  Append From Array laMatrix Fields cu_fname
  Locate
  This.RecordSource='CURS_MATRIX'
  This.ColumnCount = 2
  With This.Columns(2)
    .AddObject('chkFile','Checkbox')
    .CurrentControl = 'chkFile'
    .Sparse = .F.
    .Width = 20
    With .chkFile
      .Caption=''
      .Visible = .T.
    Endwith
  Endwith
Endproc

  Procedure QueryUnload
  Clear Events
Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform