How to bind multiple matrices to the same object ?

Using Microsoft Windows Presentation Foundation and Syncfusion WPF Libraries

How to bind multiple matrices to the same object ?

Postby PGilbert on Tue Mar 01, 2016 5:34 pm

Suppose that you have three matrices (Log1, Log2 and Log3) that you would like to bind alternatively to the same .net ListBox depending on user interaction, what is the best way to do that ? For example:

Scenario #1:
      bindLog1 ← 2015⌶'Log1'
bindLog2 ← 2015⌶'Log2'
bindLog3 ← 2015⌶'Log3'

After the bind is done the 3 matrices will continue to change (same number of columns but the number of rows will increase). When required to show a 'Log' matrix the DataContext of the ListBox is simply set to the appropriate bind:

      listBox.DataContext ← bindLog1  ⍝ or bindLog2 or bindLog3


Scenario #2:
There is only one bind that is remake all the time when needed to display one of the Log matrices:
      ⎕EX 'LogToBind'
LogToBind ← Log1 ⍝ or Log2 or Log3
bind ← 2015⌶'LogToBind'
listBox.DataContext ← bind


Scenario #2 correspond to the documentation that is always erasing the matrix to bind before binding and oblige to have a double of the matrix that you want to bind before binding. Scenario #1 correspond more to our actual case where we have multiple matrices to bind one at a time to a single .net object.

Question: Is Scenario #1 can be safely done ? Is there another approach that is better ?

Thanks in advance,

Pierre Gilbert

Note: Binding a large matrix to a .net ListBox is crazy fast with 2015⌶ and is faster than binding with a .net DataTable. Congratulations and thank you Team Dyalog for that.
User avatar
PGilbert
 
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: How to bind multiple matrices to the same object ?

Postby PGilbert on Sat Mar 12, 2016 1:08 pm

Never mind. I was not able to make it work. I will use a DataTable for binding.
User avatar
PGilbert
 
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: How to bind multiple matrices to the same object ?

Postby JohnD|Dyalog on Mon Mar 14, 2016 3:57 pm

Hello Pierre,

I would expect both scenarios to work. You say that you couldn't get it to work though. Was this scenario 1 or 2? Can you send us a repro of what you tried?

Regards
John Daintree
User avatar
JohnD|Dyalog
 
Posts: 74
Joined: Wed Oct 01, 2008 9:35 am

Re: How to bind multiple matrices to the same object ?

Postby PGilbert on Mon Mar 14, 2016 4:41 pm

Hello John, it was a variation of Scenario #2. I am in discussion with Vince on that matter. Hopefully we will get it resolve this week.
User avatar
PGilbert
 
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada


Return to WPF & Syncfusion

Who is online

Users browsing this forum: No registered users and 0 guests