Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
649
How can I retrieve the data from ultrawingrid?
posted

Hi,

How can I retrieve the data from ultrawingrid?

Firstly i added the ultrawingrid object to the script (“UltraGrid1Net()”). then

 Dim MyTable As UltraGridTestObject

 

 

  Dim Row As Integer

        For Row = 0 To MyTable.GetRowCount() - 1

            Dim Col As Integer

            For Col = 0 To MyTable.GetColumnCount() - 1

              msgbox("Value at cell {0}, {1}, {2}: {3}", ("Row"), ("Col"), ("is"), MyTable.GetCell(Row, Col)))

            Next Col

        Next Row

I got the above code from net and I modified according to my requirement, when I’m trying to compile the above code it is giving me the following error:

“Type ‘UltraGridTestObject’ is not defined”

Pls let me know is ‘UltraGridTestObject’ is right to use for ultrawingrid or let me know the appropriate object to use.

Parents
  • 6729
    Offline posted

    Another way to do this will be to use the GetData method of the grid test object, here is how:

     Dim MyTable As Infragistics.RFT.NetTestObjects.UltraGridTestObject = UltraGrid1Table()

     Dim data As Infragistics.RFT.Shared.Values.Array2DValue = MyTable.GetData(Nothing)

     Dim Row As Integer

     Dim outputText As String

     For Row = 0 To data.RowCount - 1

     Dim Col As Integer

     For Col = 0 To data.CellCount - 1

    outputText = String.Format("Value at cell {0}, {1}, is: {2}", Row, Col, data.GetValue(Row, Col))

    LogTestResult(outputText, True)

    Next Col

    Next Row

Reply Children