Hello,
i´m trying to refresh a xamgrid dynamically but i can´t.
I have a object wich it is a list of objects and i visualize it with xamgrid.itemSource.
Then i modify or add an object and want to see the new xamgrid.
I tried with xamgrid.itemSource=the modify list but it doesn´t work.
this is my code.
Sub entityHandler(EntityObj As Object)
Try
If (EntityObj Is Nothing) Then
MessageBox.Show("No tiene datos cambiados")
Else
MessageBox.Show("Tiene datos cambiados")
Dim valuePropertyId As Object = EntityObj.GetType().GetProperty(Me.myEntityList.CampoId).GetValue(EntityObj, Nothing)
'here i add a entity to the list of entities
If valuePropertyId = 0 Then
Me.myEntityList.Entities.Add(EntityObj)
'here i search and modify an object
For i As Integer = 0 To Me.myEntityList.Entities.Count - 1
Dim valueProperty As Object = Me.myEntityList.Entities(i).GetType().GetProperty(Me.myEntityList.CampoId).GetValue(Me.myEntityList.Entities(i), Nothing)
If (valueProperty.Equals(valuePropertyId)) Then
Me.myEntityList.Entities(i) = EntityObj
'here i try to visualize the new list
Me.dataGrid.ItemsSource = Me.myEntityList.Entities
Exit For
End If
Next
'here i try to visualize the new list with the object add
Catch ex As Exception
MessageBox.Show("EntityHandler Error" & ex.Message)
End Try
End Sub
I tried to make a function
Me.LayoutRoot.Children.Clear()
Me.LayoutRoot.Children.Add(te)
but it doesn´t work because i´m working with a user control and is inside another controls. And it´s going to be use recursively.
Thank you for your support.
Sincerely
David A
Hello David,
Thank you for your post. I have been looking into it, but it seems like I am missing something about your scenario, so could you please send me an isolated sample project, where this is reproduced, so I can investigate it further for you.
Looking forward for your reply.