Home Forums WinForms controls Xceed Grid for WinForms finding a value in the grid

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13862 |

    hi, i am writing a test script on a application that uses this grid. i want to pass a value and then find that value on the grid. any idea how i do this? it’s kinda like my function is parametized so whatever i put in the parameter will be searched in the grid.

    hope you can help me.

    thanks..

    amberrv

    Imported from legacy forums. Posted by amberrv (had 2803 views)

    User (Old forums)
    Member
    Post count: 23064

    Do you only want to search in 1 of the columns, or in all the columns and all the cells?
    Are you using C# or VB.NET?

    Imported from legacy forums. Posted by Tommy (had 180 views)

    User (Old forums)
    Member
    Post count: 23064

    I am searching in more than 1 column. I am actually recording in TestComplete but I use VBscipt.

    Thanks.

    Imported from legacy forums. Posted by amberrv (had 342 views)

    User (Old forums)
    Member
    Post count: 23064

    Try this (untested code):<code>Dim row As Xceed.Grid.DataRow
    Dim cell As Xceed.Grid.DataCell
    For Each row In grid.DataRows
    For Each cell In row.Cells
    Dim value As Object = cell.Value
    If value = valueToSearch Then
    ‘ found the value
    End If
    Next
    Next</code>

    Imported from legacy forums. Posted by Tommy (had 3879 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.