How to bind multiple matrices to the same object ?
4 posts
• Page 1 of 1
How to bind multiple matrices to the same object ?
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:
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:
Scenario #2:
There is only one bind that is remake all the time when needed to display one of the Log matrices:
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.
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.
-
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 ?
Never mind. I was not able to make it work. I will use a DataTable for binding.
-
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 ?
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
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
-
JohnD|Dyalog - Posts: 74
- Joined: Wed Oct 01, 2008 9:35 am
Re: How to bind multiple matrices to the same object ?
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.
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group