Hi All,
I have an odd command binding problem going on that I can't seem to iron out. I have a custom complex object that is stored in an ObservableCollection and bound to the xamDataGrid as part of a ViewModel. On the ViewModel I have a Composite Application LIbrary (Prism) command. All is working as expected apart from the command.
One of the properties of the complex object is a UserControl that contains a button that plays an audio file. This button is used in an UnboundField in the xamDatagrid the field is defined like:
Field idPlayButton = new Field(); idPlayButton.DataType = typeof(Button); idPlayButton.Name = "PlayButton"; idPlayButton.Label = "Play Sample"; FieldList.Add(idPlayButton);
The command on this button in the UserControl is:
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}, AncestorLevel=2}, Path=DataContext.PlayCommand}"
All of this is working as expect for the records in the xamDataGrid that are rendered in the UI. The buttons in each record play the relevant audio file, as soon as you scroll down to view further records it appears that the command hasn't been bound to these buttons. I have altered the screen size to show more and less records and I see the same behaviour each time. The records you can see at startup play the audio files whilst those not rendered at startup don't ...
Does anyone have anyideas as to what is going on here? The only way I've gotten each button to correctly bind to the command is to set:
RecordContainerGenerationMode="PreLoad"
But this means my app ends up using over a gig of RAM!! And it makes the app and the xamDataGrid incredibly sluggish. Any input or ideas would be really appreciated.
Thanks,
James.
Hello,
Since the behavior you have is not a known issue, could yu please modify the sample I sent you, so it reproduces your behavior, so I could be able to investigate this further for you.
Looking forward for your reply.
Thank you for your post I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Did you get any solution for this . We are also facing similar issue in our project .
In our project, We have a Button which is being displayed as a column in a xamdatagrid . Everything works fine When grid loaded initially . However when we move data ( Using Filtering / Sorting ) . Buitton binding with the selected rows doesn't work. If user clicks button on row #4 the actually click command gets executed for some other rows .
Please let us know if you get any solution for this issue.
Sounds VERY related if you ask me!
I'm going to get in touch with Infragistics support directly I think. This forum doesn't seem to get my traffic unfortunately.