Register to post in forums, or Log in to your existing account
 

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.     Home » Forums » General zApp Discussion
Tarn
GURU


Joined: 10 Oct 2000
Posts: 867
Location: USA

PostPosted: Thu Apr 28, 2005 3:09 am   

Grid
 
I'm having a bit of trouble using it (Apr 22 build).

The script:
Code:

   example.rowcount = 4
   example.colcount = 4
   example.cell(2,2) = "2"

gives me a grid 4x4, but doesn't put any text into the cells.

Assigning a 4x4 array with something in it to the data property does work:
Code:

   dim testdat(4,4)
   example.rowcount = 4
   example.colcount = 4
   testdat(1,1) = "hello world"
   example.data = testdat

But, the following doesn't make the two value visible at first. It becomes visible if you use the arrow keys to highlight the cell with the "2" in it (and the "2" is visible afterwards even if you move back):
Code:

   dim testdat(4,4)
   example.rowcount = 4
   example.colcount = 4
   testdat(1,1) = "hello world"
   example.data = testdat
   example.cell(2,2) = "2"


Also, a few questions on functionality:
Can we control whether a cell is editable on a row by row, col by col, or individual cell basis?

Can we specify how many "header" rows/colums there are? As an example, I might want to have two header rows that look different ant the user can't enter data into: one for the name of the column, and one for the units of the quantities displayed underneath. You also might want to have a fixed column or two to show index numbers or names of the row object.

Is there a Rows equivalent of the Columns property? Sometimes an entry table for the user should have only a few columns but quite a few rows (entering lots of data fields for one object, versus entering a couple of data fields for a lot of objects),

Can we merge adjacent cells with identical text values? This is important in header rows to allow grouping columns visually (example: if you've got two header rows, merging adjacent cells in the top row).

-Tarn
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Apr 28, 2005 6:05 am   
 
Whenever you update data in a grid directly, be sure and call Grid.DataChanged to force the grid to update itself. Otherwise you won't see any of your changes.

To control the edit status of a column, see the Column.AllowEdit property. You currently can't control the edit ability on a cell by cell basis, nor on a row by row basis.

There is only one header row. It's not a traditional cell row, like in Excel. Rather, it is a more formal column header that can be clicked on to sort, filter, etc. It is controlled by the zColumn object that defines the column. I'll consider fixed rows and columns in the future.

The current grid is "column based". It assumes lots of rows and a limited number of columns. There is something in DevExpress called a "Vertical grid" that is the opposite...lots of columns but limited rows. I'll be adding that to zApp in the future, but not for the first public release.

Not really sure what you mean by merging cells. It's not like an HTML table where you have complete control over cell merging (you can always use the Tables in the zMemo control for that if you need it). The grid supports grouping already either interactively (drag the column header to the Group box if ShowGroupBox is set to true), or set the zColumn.GroupIndex property.

In general, be sure you have read all of the topics in the zGrid area...there is a lot of documentation there. Also, in the future please try to remember to number your questions when you post multiple questions in a topic to make it easier to answer.
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 867
Location: USA

PostPosted: Thu Apr 28, 2005 7:19 am   
 
Ok. I have read everything under the Grid topics, but I missed the cross reference to the Column section.

(1)
The following code results in nothing appearing in the grid (the only properties set in the XML are name='example' and alignment='client'):
Code:

   example.rowcount = 4
   example.colcount = 4
   example.cell(2,2) = "2"
   example.DataChanged

Is something else required to be called? Do you always have to feed the Grid an array via ".data =" (or assign a database connection) before using it?

(2)
What I meant about merging cells: sometimes columns come in groups which should be presented that way to the user. Example: in QuickBooks, a check register has two columns under the "Payee" heading, "Account" and "Memo." This is presented as two column headings (in the first two rows), with "Payee" in what looks like a single cell above spanning both columns (requires two header/fixed rows).

-Tarn
Reply with quote
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Home » Forums » General zApp Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2009 Zugg Software. Hosted on Wolfpaw.net