Yeah I know the title sounds funny. It is, but like kids they are going to make me crazy.
Ok here is the stiuation. I need to get the transactiontableid datavalue if it is changed (band 2) then the elementid displaytext (band 1?) and the AllocatorID (band 2 child 1?) and then change the value list in RuleName (band 2 child 1 child 1?). The valuelist for RuleName would also be changed for all allocatordetail childs in such manner. I have tried Parent, Selected row and nothing is working. Please help and thank you....
url for full image is http://www.kjmsolutions.com/images/gridconfusion.jpg
I have no idea why but this appears to work.
Private Sub dgElements_AfterCellUpdate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles dgElements.AfterCellUpdate
If e.Cell.Column.Key <> "TransactionTableID" Then
Exit Sub
End If
ElementID = e.Cell.Row.ParentRow.Cells(0).Value
trantableid = e.Cell.Value ' Since this is what we're checking to see if it changed at the beginning
allocatorid = e.Cell.Row.ChildBands.FirstRow.Cells("AllocatorID").Value()
'allocatorid = e.Cell.Row.ChildBands(0).Rows(0).Cells("AllocatorID").Value
'ElementID = dgElements.Rows(dgElements.ActiveRow.GetChild(0).Index).Cells(0).Value
' trantableid = dgElements.ActiveRow.Cells("TransactionTableID").Value
'Debug.WriteLine(dgElements.ActiveRow.ChildBands(1).Rows.Count - 1)
'allocatorid = dgElements.ActiveRow.ChildBands(dgElements.ActiveRow.GetChild(0).Index).Rows(0).Cells("AllocatorID").Value
"select DISTINCT AllocatorDetailRule.RuleID as AllocRuleID, AllocatorDetail.AllocatorID,Allocator.[ID] as AllocID,Allocator.ElementID,[Rule].[ID] as RuleID,[Rule].[Name] as RuleName, [Rule].TransactionTableID as RuleTranID, TransactionTable.[ID] as TranID,TransactionTable.[Name] as TranName,Element.[ID] as EleID FROM AllocatorDetailRule, AllocatorDetail, Allocator, [Rule], Element, TransactionTable WHERE Allocator.ElementID = Element.[ID] and AllocatorDetail.AllocatorID = Allocator.[ID] and [Rule].TransactionTableID = TransactionTable.[ID] and [Rule].[ID] = AllocatorDetailRule.RuleID and Element.[ID] = " & ElementID & " and AllocatorDetail.[AllocatorID] = " & allocatorid & " and [Rule].TransactionTableID = " & Me.trantableid & " ORDER BY RuleName"
Dim oDa As New SqlDataAdapter(strSQL, oConn)
oDa.Fill(dt)
RulesList.ValueListItems.Clear()
Dim i As Integer
RulesList.ValueListItems.Add(dt.Rows(i).Item("RuleID"), dt.Rows(i).Item("RuleName"))
Next
For i = 0 To e.Cell.Row.ChildBands.FirstRow.ChildBands.Count - 1 'dgElements.ActiveRow.ChildBands(0).Rows(0).ChildBands.Count - 1
Dim ii As Integer
e.Cell.Row.ChildBands.FirstRow.ChildBands(i).Rows(ii).Cells("RuleName").ValueList = RulesList
End Sub
the one marked "ME Orders Volume" in Allocations is the one failing. Are we talking about the same thing here?
Just to make sure we are seeing the same thing. The Allocator "ME ORDERS VOLUME" is the one that fails when we change the transaction id. ME ORDERS OP works find when we change the transactionid.
http://www.kjmsolutions.com/images/notcollapsed.jpg
Is there more than one child band? I'm not really sure what could be causing the issue at this point, especially if it's working for the first Allocator row and not any subsequent rows.
As a side note, it would be more efficient to use the GetCellValue method on the row instead of the Cells(...).Value, since the latter will cause the Cell objects to be created if they haven't been already. This is a moot point if you've already rendered all the cells, but couldn't hurt to code it in this fashion.
-Matt
It seems as same as before. The top row in Allocator will work fine if I change the transactiontableid. The second row in Allocator fails on the assignment of allocatorid.
Added Note: It appears to think there are -1 rows present in this child though that is not the case here. This happens in any row that is not the first row of Allocators.