Populate a Text Box from a FlexGrid


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Populate a Text Box from a FlexGrid

  1. #1
    Join Date
    Apr 2005
    Posts
    53

    Populate a Text Box from a FlexGrid

    Hi,
    Those who helped with my last problem may understand what I am trying to do....
    basically, I have a flexgrid with 3 columns, SCORE PING PLAYER-NAME
    and there are around 15 rows, (it varies depending how many players are on the server)

    What I want to happen is when I click on a row, Three text boxes fill with the information in that row. then when i click different row, they textboxes then fill with the data in that different row.

    Jenks

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    When you click on a new row, the flexgrid raises a RowColChanged event. In that event, you can use the TextMatrix property to read data from the desired cells, or simply read the data from the underlying data source.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Apr 2005
    Posts
    53
    i did that...with this code ..

    Text1.Text = MSFlexGrid1.TextMatrix(intCurRow, 0)
    then, when I click on a row in the grid...the text1.text fills with the word ping which is the first cell in the first column.....when i click on other rows, it doesnt change...

    any ideas..

    JenKS

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    What is the value of intCurRow? Where/how are you setting it?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Apr 2005
    Posts
    53
    I am using this which i found in another example....

    Dim intCurRow As Integer
    Dim strCell1 As String
    Dim strCell2 As String
    Dim strCell3 As String

    intCurRow = MSFlexGrid1.Row
    strCell1 = MSFlexGrid1.TextMatrix(intCurRow, 0)
    strCell2 = MSFlexGrid1.TextMatrix(intCurRow, 1)
    strCell3 = MSFlexGrid1.TextMatrix(intCurRow, 2)

    which I am putting under - MSFLEXGRID1_Click()

    is this right? if not, what have i done wrong?

    JenkS

  6. #6
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392
    Instead of using the "Row" property, try the "MouseRow" property.
    Bob Rouse
    Dimension Data

  7. #7
    Join Date
    Apr 2005
    Posts
    53
    Ive got it to work...thanks alot

    JenKs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center