Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I would like to ask you, how can I create real-time data presentation in my Datagrid? I have model created with ADO.NET Entity Data Model, and to fill my DataGrid I'm using linq + I'm using MVVM light here as well.

VB
Using entityconn As New TimerConn()
                Dim result = (From i In entityconn.tbl_Main_Timer Order By i.ID                    Descending).ToList()
                For Each act In result
                    UserDetails.Add(act)
                Next
End Using


In my previous application I was using DispatcherTimer, but it locks UI for a while.

I would like to have my data dynamic. If something will change, user will see it.

Should I use Async? Task.Run? or maybe there is other method to do this?

Thank you for any ideas on that.
Posted
Updated 13-Jul-15 0:14am
v2
Comments
Herman<T>.Instance 13-Jul-15 6:27am    
both async/await and Task.Run do the same. Don't forget to Invoke.
One nightmare: What if you want to refresh the grid while someone is editing a row?
LordVovin 13-Jul-15 6:35am    
Data here are static, if it's already in the database, user is not able to change it. This is only to present already 'logged tickets'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900