I am using xamdatagrid in a number of places in my application, which is MVVM. I am binding to an asynchronous collection. and I can pick up SelectedCollectionItemin my view model.
My column is defined as
<ig:Field Label="Pick Qty" AlternateBinding="{Binding Quantitypicked, Mode=TwoWay}" > <ig:Field.Settings> <ig:FieldSettings AllowHiding="Default" AllowEdit="True" Width="100" IsAutoEditModeEnabled="True" /> </ig:Field.Settings> </ig:Field>
I have a user control which displays a grid of data in the SelectedColletionItem beside the xamDataGrid
This allows me to edit the value but I need some help to get it to work as I require.
When I edit the value I haev to press ENTER to complete the entry, which is fine. however my view model isn;t aware that anything has happened - the SelectedCollectionItem set property in the VM is not called. So teh data grid beside the XaDataGrid is not updated with eth value I have just entered.
But if I move off the current row in teh Xamdata grid and return to it, the dfta agrid is refreshed with the value i just entered.
That makes sense to me. I just need to be able to update my SelectedCollection Item when an entry is made in to the list.
Also I would like to be able to move onto the next row in the XamDataGrid, in the same column, exactly as if I had pressed downarrow,
I have no idea where to start with this, but the documentation does seem to imply its possible. I just don;t understand it
Hi. Thanks for your help on this. The application works fine and has been in production for 4 months. I have noticed though that the Microsoft.xaml.behaviors.dll takes a long time to load - 10 seconds out of a total of 20 seconds. It happens in debug and release modes, and on the production servers. I tried following this up with Microsoft, but their sample application for the Microsoft.xaml.Behaviors.dll loads instantly, so I seem to have my issue when I use it with IG. Have you any suggestions ?.
My DEV PC is quad core, 32GB RAM with SSDs. For the production server I NGEN it and install it in GAC, but it makes no difference
Hello Gordon,
Thank you for your update on this matter. I am glad this is working in your application.
Regarding whether you can extend the behavior to allow the up and down arrows keys, you absolutely can. The behavior I sent you is already handling the PreviewKeyDown event, and you would essentially just need to check the Key property of the event arguments for Key.Up or Key.Down. From there, you can fire the DataPresenterCommands of CellBelow or CellAbove, like is currently done in the EditModeEnded event in the existing behavior.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
Thanks so much for the help you gave me. Its now working great in my application.
I have a followup question.
Is is possible to use behaviors to also allow the up arrow key to move up a line and teh down arrow key to move down a line in the grid - particularly on the field being edited ?
Thank you for your update on this matter.
Personally, I have no prior experience with synergy.net and barely know what that actually is, but I don’t foresee the conversion being too difficult as the Behavior in the sample project I gave you is essentially just handling the EditModeEnded and PreviewKeyDown events on the XamDataGrid in an MVVM way.
As such, rather than bringing the entire sample project I gave you over, I would likely just recommend converting the code to work in synergy.net, assuming the Infragistics for WPF controls do actually work there as this is not an officially supported environment.
Please let me know if you have any other questions or concerns on this matter.
Thanks this example now builds and runs for me. My application is actually synergy.net and not c# .net. Is it possible to put your code in a separate project within the solution so I could call it from the synergy.net code ? Could I just call it from the synergy.net code behind and pass the same arguments over to it ?
I could also have a go at converting your code to synergy.net.