Jack J

Jack J

  • NA
  • 4
  • 13.6k

Datagrid ItemsSource update UI

Aug 24 2010 2:32 PM

Hi,

When I change source of ItemsSource property columns suddenly disappears. What i am doing wrong? I am using DataTable for ItemsSoruce. I want to add some more columns thats why i am changing ItemsSource. 

//pseudo code, initialize control

DataTable dt = new DataTable();

DataTable dt2 = new DataTable();

datagrid.ItemsSource = dt.DefaultView;  //auto-generates column headers, everything is OK 


// button click

datagird.ItemsSource = dt2.DefaultView; //columns disappear, UI not updated?


Pls, Help me!

regards

Jack :)


Answers (1)