1 Replies - 8423 Views - Last Post: 08 November 2013 - 05:51 AM Rate Topic: -----

#1 mauro21pl  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 11
  • Joined: 10-May 13

WPF ObservalbleCollection databinding with dynamic columns

Posted 21 May 2013 - 09:22 AM

Hey guys
Recently I was playing with [ObservableCollection] in WPF, and I am very impressed with speed of UI updates.

I do have one project that I could find fit for, however there is a small tiny problem (always is :)). In that project I have dynamically generated number of columns, and these columns are being dynamically named by user. Currently I am using DataTable that acts as data source for my grid view, and for every DataTable change i simply rebind to show UI updates. I know it is not the best way to do that, especially in WPF, but it works as expected and fast enough for small number of records. However, if I will need to deal with very large number of records, there is slight delay in UI updates, and I would like to change that.

After [ObservableCollection] implementation, I do not receive any kind of UI delay whatsoever. The UI response is instantaneous, I love it. However its implementation has static number of fields and names of columns. It has to by dynamic.

Would you guys be able to point me the right direction to resolve the issue

Is This A Good Question/Topic? 0
  • +

Replies To: WPF ObservalbleCollection databinding with dynamic columns

#2 mavarazo  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 37
  • View blog
  • Posts: 182
  • Joined: 25-October 10

Re: WPF ObservalbleCollection databinding with dynamic columns

Posted 08 November 2013 - 05:51 AM

I would try to make a Dictionary<Key, Value>, where the Key would be the Columns.
To achieve the same as the ObservableCollection, u need to implement the INotifyPropertyChange for the Dic-Property.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1