Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
141
show last record when new record is added to xamdatagrid
posted

Hi,

 i am usind xamdatagrid to log data in my application.

I am using MVVm pattern and I have a observable collection of log messages.

I would like the grid to always show the last record been added in my grid.

How can I do that ?

Is there an easy way to do that in XAML only by binding RecordLastOverall command to record added event?

BR

Peter

Parents
  • 9836
    Verified Answer
    posted

    Hello Peter,

    If case you are adding the records through the UI, then you may use some of the MVVM approaches to handle this. For example you can use the attached behaviors presented in the Microsoft's Interactivity framework to associate an event (RecordAdded) to a command. If you add new items directly to the datasource, then you could execute this command from the viewmodel passing an instance of the grid as a command parameter.

    Let me know if that helps.

Reply Children
No Data