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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting the column values in a grid

Status
Not open for further replies.

vnbabu

Programmer
Joined
Jul 15, 2003
Messages
14
Location
IN
Hello Everyone.

I want to get value of each column of the grid in a row, How do I achive it.

My problem In detail

Grid recordsource is a SQL Query.

My Grid has three columns - : 1 column - String , 2 column - Date & 3 column - Numeric

messagebox(thisform.grid1.column1.text1.value)
messagebox(dtoc(thisform.grid1.column2.text1.value))
messagebox(str(thisform.grid1.column3.text1.value))

When I put this code in the double click even of the Grid.

I get correct value of the column in whcih the cursor is active, regarding the other 2 columns only pervious values are displayed. Why is this ? What is my mistake ! If I activate the coloumn each time by using activatecell I get the correct value.

Is this the way to get value of the coulumns in a grid ? or any other perfect way.

Please help me out

Thank you all in advance.

Regards


Babu
 
maybe you need to do a refresh() ?
thisform.refrsh()
-Bart
 
Babu,

When I put this code in the double click even of the Grid.

Did you mean to say grid? Have you tried putting the code in the double-click of each individual textbox?

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
I agree wholeheartedly with BPeisch. unless you are doing some display formatting with the textboxes or they are your own class and you have some special code running in a value_access method, there is no reason to access the values of the control. Grab the value from recordsource of the grid using the controlsource of the column (or textbox).

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top