Below is the code snippet we are using to set the value to the specified cell using row number(first row) and column number(first column) in the ultrawingrid table.
'Find Ultrawin grid Dim objUltra As UltraGridTestObject objGlobal.tObj = objGlobal.objWinformSec1.Find(AtChild(".class", "Infragistics.Win.UltraWinGrid.UltraGrid", "Name", "grdPolicy_PolCommlInfo_PolLocations_PolGrdLocations")) If objGlobal.tObj.Length > 0 Then objUltra = CType(objGlobal.tObj(0), UltraGridTestObject) Else LogError("Filed to find the ultrawingrid") Exit Function End If
'Set the value to the row first row and first visble columnobjUltra.SetNAProperty("Rows.Cells.Value", "New Value")
However there are some hidden columns in the grid table, so we are unable to give the exact column number to set the value. Suppose if we need to set the value to the first row and first column mentioned in the above code snippet, we are giving column(Cells) value as 4, because there are another 4 hidden columns existed before this visible column(first column) in the table. So is there any specific method or property to set the value using row number and visible column name (instead of index(4)).
Please let us know, if you need any more information.
Thanks & Regards,Vijay Jadi.
You can use the column key instead of its index. So for example if the column you want to set is called "EmployeeName" (This is the column key not its caption) so you can use :
objUltra.SetNAProperty("Rows.Cells[EmployeeName].Value", "New Value")
You need to check with your developer on the column key, or use a loop to get the key and header of each column.
With any of these below code I encountered this error message: "unable to convert from 'System.String' to 'System.Int32'"
Approach1: SwfWindow("VAPP8 | xSwitchConfig").SwfWindow("Outbound Dial Plan").SwfTable("grdTable").SetNAProperty "Rows.Cells[destGUID].Value","Station : BELLEVUE_ESRP_GL"
Approach2: SwfWindow("VAPP8 | xSwitchConfig").SwfWindow("Outbound Dial Plan").SwfTable("grdTable").SetCellData "7", "destType", "trunkGroup"
Please advise the soluction for this error
Thanks & Regards,