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

Datawindow getting data from a 2 columns when a row is selected ? 1

Status
Not open for further replies.

Delphiwhat

Programmer
Apr 1, 2003
74
0
0
EU
hi folks

I have a datawindow which consists of 15 columns. When any single row is selected I want to be able to populate 3 variables with the contents of three columns from that particular row. eg colums 2 4 and 6. In this example my variables would be populated as follows. varoable 1 = blue. varoable 2 = red. varoable 3 = white Any ideas??? thanks i n advance.


col1 col2 col3 col4 col5 col6 col7 col8 ......
data data data data data data data data
data Blue data red data white data data
data data data data data data data data


can i do

varable 1 = this.Object.col2[row] = (data)

thx
 
Use SETITEM instead of Object.col2

Look up SETITEM help.

Regards
 
I believe you are trying to pupulate your variable based on the selected row for those 3 columns.

You can use
a.GETITEMSTRING
variable1 = this.GetItemString(row,'col2')
variable2 = this.GetItemString(row,'col4')
variable3 = this.GetItemString(row,'col6')

or

b.dot notation
variable1 = this.Object.col2[row]
variable2 = this.Object.col4[row]
variable3 = this.Object.col6[row]


 
I believe you are trying to pupulate your variable based on the selected row for those 3 columns.

You can use
a.GETITEMSTRING
variable1 = this.GetItemString(row,'col2')
variable2 = this.GetItemString(row,'col4')
variable3 = this.GetItemString(row,'col6')

or

b.dot notation
variable1 = this.Object.col2[row]
variable2 = this.Object.col4[row]
variable3 = this.Object.col6[row]


Hope this helps.
Have fun!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top