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!

Grid Problem, Please help me out !

Status
Not open for further replies.

manosubbiah

Programmer
Jan 2, 2001
8
IN
Hai,
I am new to vfp programming.
1) How to get the value of a particular cell in a grid i.e if I specify the row and column , i should get the value.

2) How will i get the row number in a grid where the cursor is?

Thanx for any help in advance.
Mano
 
Hi!

Grid does not works on the row level. It shows the data from cursor, so value of particular cell in grid is the same as a value of the appropriate field of particular record in the cursor (table). 1 record = 1 row. Record number, however, is not number of row. It is hard to determine the row number, you can do this by manual calculation over the cursor used for grid. This because grid is quite universal daa displaying control that displays data properly to the records order, reflects changes (deleted records), reflects filters etc etc. Grid just scans records and displays them, it does not store data separately in memory (that is its great benefit and where its speed comes from), thus it does not know really the row number. You can take the ActiveRow property, but it is just a row in visible part of grid and it is available only when grid is focused.

Just describe exactly what you want to design with grid, so we will be able to make some recommendations to you about the best approach.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
This begins to make sense. I've got a similar problem and perhaps helping me will help Mano.

I've got a form with a text box displaying the Department Number of the department 'owning' a given project from a 'project' table. When I click on this box, I have a grid appear with a list of the Department Numbers and Department Names from a different 'cost center' table. When you double click the grid, I want to have the department number from the row of the grid the double click was made in transfered to the first table (and thus the text box). What's the best way to do this? Thanks! -- Dave
 
Hi!

When grid current row changes, current row in the grid's cursor alias changes too. So, in Double Click event you can use a value from a field from the current row of the alias used to display by grid.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top