Question

Am trying to access the childs of my ultrawebgrid but am not sure what code is the correct one for asp.net. I know in vb.net i used the same code and it was fine. I get the error : MissingMemberException was unhandled.Public member 'getChildRow' on type 'GroupByRow' not found. Anyone has any ideas?

Here is my code

Protected Sub UltraWebGrid1_InitializeLayout(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraWebGrid1.Click
        Dim rowSelected As UltraWebGrid
        Dim orderID As Integer
        Dim finalPriceData As OracleDataReader

        For Each rG1 In UltraWebGrid1.Rows
            For Each rL1 In rG1.getChildRow
                For Each rowSelected In UltraWebGrid1.DisplayLayout.SelectedRows
                    orderID = rowSelected.Rows.FromKey("ORDERID").ToString
                Next
            Next
        Next
Était-ce utile?

La solution

In short, you get the exception because there is no such method/property named getChildRow in the control's rows. Based on my limited knowledge of VB.NET and UltraWebGrid, you may want to try out following things:

  1. Change getChildRow to getChildRow() - this is assuming that earlier syntax is searching from property while later would search for method.

  2. A row of type GroupByRow may not have getChildRow member and so you may want to skip that kind of row - For Example
    If TypeOf(rG1) IS NOT GroupByRow Then
    For Each rL1 In rG1.getChildRow

  3. Lastly, from documentation, it appears that grid contains rows of type UltraGridRow and probable code for iterating child rows may go something like

-

For Each rG1 In UltraWebGrid1.Rows
   If rG1.HasChildRows Then
      For Each rL1 In rG1.Rows
         ...
      Next
   End If
Next
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top