Home Forums WinForms controls Xceed Grid for WinForms Detail Grid’s Rows "Disappearing"

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15612 |

    I can successfully populate a Master and Detail grid, but if I add a new detail record and need to reload the grid to reflect the change, the detail grid never displays anything.

    Pertinent snippets are below…Any help would be much apprecaited!

    grdClasses.DataRows.Clear()
    grdClasses.BeginInit()

    AddHandler grdClasses.InitializingDetailGrid, AddressOf Me.dtlClassMembers_InitializingDetailGrid

    For Each row As DataRow In ds.Tables(“classes”).Rows

    Dim rowAdd As Xceed.Grid.DataRow = grdClasses.DataRows.AddNew()
    rowAdd.BeginEdit()

    currentClassID = row(“class_id”)
    rowAdd.Cells(“colClassID”).Value = row(“class_id”)
    rowAdd.Cells(“colClassName”).Value = GetDBValue(row(“class_name”))
    rowAdd.Cells(“colGradeName”).Value = GetDBValue(row(“grade_level_name”))

    rowAdd.EndEdit()

    Next
    grdClasses.EndInit()

    Private Sub dtlClassMembers_InitializingDetailGrid(ByVal sender As Object, ByVal e As Xceed.Grid.InitializingDetailGridEventArgs)

    If Not currentClassID = previousClassID Then

    Dim ds As DataSet = dataWS.ReturnDataSet(Compress(xmlDoc.InnerXml))
    For Each row As DataRow In ds.Tables(“members”).Rows

    Dim rowAdd As Xceed.Grid.DataRow = e.Grid.DataRows.AddNew()
    rowAdd.BeginEdit()
    rowAdd.Cells(“colUserID”).Value = row(“user_id”)
    rowAdd.Cells(“colMemberName”).Value = GetDBValue(row(“user_first_name”)) & ” ” & GetDBValue(row(“user_last_name”))
    rowAdd.Cells(“colUserType”).Value = GetDBValue(row(“user_type_name”))
    rowAdd.EndEdit()

    Next

    End If

    previousClassID = currentClassID

    End Sub

    Imported from legacy forums. Posted by Jason (had 1870 views)

    User (Old forums)
    Member
    Post count: 23064

    Never mind….this was me being a complete bonehead. In the Sub that handles the InitializingDetailGrid event, currentClassID WAS EQUAL to previousclassID so the loop never was hit.

    Quite embarrassing, actually.

    Thanks to everyone to viewed the post and gave it some thought.

    Imported from legacy forums. Posted by Jason (had 3050 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.