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
325
How to set the value to the cell in UltrawinGrid using row number and visisble column Name
posted

Hi,

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 column
objUltra.SetNAProperty("Rows[0].Cells[4].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.

Parents
  • 6729
    Verified Answer
    Offline posted

    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[0].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.

    Regards,

    Ammar

     

Reply Children
No Data