SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Apr 2004
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Issue with DataGridView

    Question
    -----------------------------------------
    Has anyone had this type of issue before?

    Application Overview
    -----------------------------------------
    The application is data retrieval into a DataGridView control. Search on information that meets these parameters and return the data into the grid.

    Problem
    -----------------------------------------
    When executing grid methods (SwfTable) performing another search prevents the DataGridView from displaying again. Methods that have caused this issue include; RowCount, GetCellData.

    Code Sample
    -----------------------------------------
    For iRow = 1 to SwfWindow("").SwfTable("").RowCount
    SwfWindow("").SwfTable("").SelectRow iRow - 1
    sNumber = SwfWindow("").SwfTable("").GetCellData (iRow - 1, "Number")
    Next

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Issue with DataGridView

    Is it possible to avoid the .SelectRow?

  3. #3
    Junior Member
    Join Date
    Apr 2004
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue with DataGridView

    Yes I am not going to use the SelectRow. I have found that the following line works fine when there are more than 1 rows returned. I have yet to find a command that works with one row only.

    > SwfWindow("").SwfTable("").Object.Item(3,1).Value

  4. #4
    Junior Member
    Join Date
    Apr 2004
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Issue with DataGridView

    To get past this issue I made a custom class to keep track of where on the grid it is and pull back information from the currentcell value. It isnt pretty but it works.

    Class Table

    'Declare Variables
    Private mRow
    Private mColumn
    Private mObject


    Private Sub Class_Initialize ' Setup Initialize Event.
    mRow = 0
    mColumn = 0
    End Sub

    Private Sub NavigateToCell (Row, Column)

    Dim i
    Dim j

    'Row
    If Row <> mRow Then
    i = mRow - Row
    If i < 0 Then
    For i = mRow to Row-1
    mObject.Type micDwn
    Next
    ElseIf i > 0 Then
    For i = Row to mRow-1
    mObject.Type micUp
    Next
    End If

    mRow = Row
    End If

    'Column
    If Column <> mColumn Then
    j = mColumn - Column
    If j < 0 Then
    For j = mColumn to Column-1
    mObject.Type micRight
    Next
    ElseIf j > 0 Then
    For j = Column to mColumn-1
    mObject.Type micLeft
    Next
    End If

    mColumn = Column
    End If
    End Sub

    Public Property Get Value (Row, Column)
    NavigateToCell Row, Column
    Value = Trim(mObject.Object.CurrentCell.Value)
    End Property

    Public Property Let Object (obj)
    Set mObject = obj
    End Property


    Public Sub Reset ()
    Dim i

    mObject.Type micHome

    For i = 1 to 20
    mObject.Type micPgUp
    Next

    mRow = 0
    mColumn = 0
    End Sub

    End Class

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:30 AM.

Copyright BetaSoft Inc.