How to fetch a specific column from ultra grid.
Need code for the same
That completely depends on what you are planning to do with the column. Are you Selecting it, sorting it, getting a property from it, do you want the column object itself, get all the data from all the rows for a particular column. Each has vastly different methods of tackling the problem.
Perhaps you can provide a bit of context to the question and it will aid me in assisting you.
Also it helps if you let me know what version of NetAdvantage that you using, and if you are using the corresponding version of TestAdvantage or not.
I wanted fetch a row based on the value in the column.
OK in this case, what you want is less the column as much as you want the row or particularly a cell in a row. The way the grid typically works is the columns are used for data definition, but the data is stored in the rows. Where the cell, is a sub object of the row defined by and confined the restrictions of the column.
So what you are looking to do is to loop through the rows of the grid, checking the value of a particular column's cell, and if the cell matches the value that you are looking for perform addition operations on the row, which at that point you would already have the row so you can do what you need from there. Below is a sample code snippet.
SET grid = SwfWindow("Form1").SwfTable("ultraGrid1")sColName = "int1"oColValue = 73grid.ActivateRow "0"iRowCount = grid.RowCountFOR iRow = 0 TO iRowCount - 1 IF grid.GetCellData(CINT(iRow), sColName) = oColValue THEN msgbox CSTR(iRow) END IFNEXT