Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixed row in grid

Status
Not open for further replies.

ipazzo

Programmer
Jan 17, 2002
69
IT
Hi dear friends,

is it possible to have a fixed row at the bottom of the grid object ?

I want to have a row at the bottom of the grid with the total of columns value.

Thanks in advance.
Ciao



Vito M. from BARI (Italy)
---------------------------------------
When you build a TEAM, try always those that they love to win. If you do not succeed to find them, then try those that they hate to lose. Ross Perot
 
Hi Vito,

You can't do that in the grid itself. The grid's rows always reflect the records in the underlying table.

However, you could create an intermediate cursor to use as the data source for the grid. You could then append an extra record to it and populate it with the totals. But it will still look like just another grid row.

I think what you probably want is to have a fixed row at the foot of the grid to hold the totals. If so, you should set this up as a set of labels or text boxes, and position them at the foot of the corresponding columns. It should look quite effective, provided you don't let the users resize of move the grid columns.

Mike


Mike Lewis
Edinburgh, Scotland
 
Thanks Mike,

yes you are right, but the problem is that i have up to 24 columns in the grid, and is impossible to fit all in a form.

I have tried using a second grid at the bottom of the first one but the problem is to sync the two grids, do you have any other suggestion ?

Thanks again



Vito M. from BARI (Italy)
---------------------------------------
When you build a TEAM, try always those that they love to win. If you do not succeed to find them, then try those that they hate to lose. Ross Perot
 
I'm developping an application for a warehouse of apparel store and they have some items that are sold in 24 sizes and the request is to show the warehouse in this format:

item description price t.qt s01 s02 s03 ...... s24
0001 skirt 10.1 10 1 1 2 ...... 2
0002 dress 11.0 12 2 2 ...... 1
.....
total 101 12 14 33 ...... 8


so there is no way to simplify the form. I think that i am obliged to insert the information in the grid, if there is not any other suggestion :(

Thanks



Vito M. from BARI (Italy)
---------------------------------------
When you build a TEAM, try always those that they love to win. If you do not succeed to find them, then try those that they hate to lose. Ross Perot
 
Vito,

I could suggest two alternatives.

- Show two grids. One holds the item numbers, descriptions and prices. When the user clicks on an item in that grid, the second grid shows the sales figures for each of the sizes for that item (one row per size). That grid would only contain one column, so you would be able to put a textbox holding the total sales at the bottom of the grid.

- Use an ActiveX Treeview control. The top level would show the item. When the user clicks on an item, they see the description and price in textboxes. The user can also drill down into an item to see each size and its sales. There would also be a node to show the total sales per item.

Of those two methods, the grids would be the easier to implement. You would basically need some code in the click event of the first grid to position the record pointer and to refresh the second grid.

Hope this helps.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top