WPF DataGrid adding extra "ghost" row

Posted by hs2d on Stack Overflow See other posts from Stack Overflow or by hs2d
Published on 2012-11-29T11:01:29Z Indexed on 2012/11/29 11:04 UTC
Read the original article Hit count: 216

Filed under:
|
|

Hei,

In my application i'm using DataGrid to show some data. To get everything working with threading i'm using AsyncObservableCollection as DataContext of DataGrid. When my application starts it looks for files in some folders and updates AsyncObservableCollection. Now here's where things go bad, when i start the application for some reason i get 2 rows with same data in DataGrid even if there is one item in collection. If i add a delay(Thread.Sleep() 50ms minimum) before executing loading files method then DataGrid show everything correctly (no extra row).

Have anybody encountered something similar or is there something else i should try? Thanks in advance!

© Stack Overflow or respective owner

Related posts about c#

Related posts about datagrid