This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
There was a thread on this in 2009 ( Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin;} a:link, span.MsoHyperlink {mso-style-noshow:yes; mso-style-priority:99; color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {mso-style-noshow:yes; mso-style-priority:99; color:purple; mso-themecolor:followedhyperlink; text-decoration:underline; text-underline:single;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} --> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} http://www.mindscape.co.nz/forums/Thread.aspx?ThreadID=2184), but it seems nothing has been done about the fact that SelectedItems is a read-only collection. Has there been any movement on this feature? It's something we require for a feature we are trying to implement currently in our system. |
|
|
Uhh, wow. I am not sure what happened with that post. Something went wacky when I copied a link in. |
|
|
Hello Matt You can programmatically select items by using the following code: element.SetValue(ListBoxItem.IsSelectedProperty, true); where element is a DiagramElement. (that is a DiagramConnectionElement or DiagramNodeElement) You will note that DiagramElements are the graphical representation of nodes and connections. If you are dealing with FlowDiagramNodes which are data model objects, then you can use the DiagramSurface.FindElement method to get the DiagramNodeElement for a given model node. Regards |
|
|
Jason, This works, but only if SelectionMode is 'Multiple'. If we set SelectionMode to 'Extended', this no longer works. This seems like a bug, as SelectionMode 'Multiple' and SelectionMode 'Extended' both imly multiple selection, but the user facing UI to do the selection is different. Is this a bug or intended functionality? |
|
|
Hello Matt I haven't been able to reproduce this issue. I tested this code with both Multiple and Extended selection modes and they both work fine. The code I used to test it simply involved a loop that selected all elements. Could you please give me any more details on what your doing and what the results are when using Extended mode. A simple repro would help too. Cheers |
|
|
Jason, Sorry for the late reply on this. We actually figured out the reproduction step. If the user has already selected an element on the diagram (with the mouse), then we attempt to programmatically loop through and select a set of objects, it fails. If we first clear all selection, then loop through our selection criteria programatically, and setting the selected state as you suggested, it works. |
|