I am new in C# and have a requirement where a DataViewGrid have fixed rows and three columns. Each column’s data is coming from different source and three threads are running simultaneously to receive it. Now, is it possible to update these columns i.e. Column one by thread one Column two by thread two Column three by thread three Without using any synchronization object? If this is not possible then I will create three DataViewGrid and which will be updated by individual threads.
DataViewGrid synchronization C#
120 views Asked by CrazyC At
2
There are 2 answers
7
On
Do you use Windows Forms or WPF? In general you can use something called Bindings. In WinForms there normally is a property "DataContext" on the UI-controls. You can update that property from other threads. You can then control which column is matched to which property of the List or array you provided to the DataContext. In WPF there are observable collection. You also map the control to a Property and then update that property from one of your threads.
It is hard to give you more advice because I am lacking information on which technology you are using and which architecture (MVC, MVVM, ...). If you need more help please update your question and provide us with more information.
Works for me, but I don't like it.