{"action":"created","issue":{"url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/65","labels_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/65/comments","events_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/65/events","html_url":"https://github.com/MarimerLLC/cslaforum/issues/65","id":110001871,"number":65,"title":"How to remove an item synchronously from DynamicListBase?","user":{"login":"Codelines","id":6958304,"avatar_url":"https://avatars.githubusercontent.com/u/6958304?v=3","gravatar_id":"","url":"https://api.github.com/users/Codelines","html_url":"https://github.com/Codelines","followers_url":"https://api.github.com/users/Codelines/followers","following_url":"https://api.github.com/users/Codelines/following{/other_user}","gists_url":"https://api.github.com/users/Codelines/gists{/gist_id}","starred_url":"https://api.github.com/users/Codelines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Codelines/subscriptions","organizations_url":"https://api.github.com/users/Codelines/orgs","repos_url":"https://api.github.com/users/Codelines/repos","events_url":"https://api.github.com/users/Codelines/events{/privacy}","received_events_url":"https://api.github.com/users/Codelines/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-06T12:56:21Z","updated_at":"2015-10-08T04:30:16Z","closed_at":null,"body":"When I call the Remove method in a DynamicListBase into a loop, the next step takes place before the asynchronous RemoveItem of the list has been finished. How can I workaround this problem please? Below is an example where ColRelationshipBO is a DynamiListBase:\r\n\r\n               ColRelationshipBO col = Relationships.SourceCollection as ColRelationshipBO ;\r\n                for (int i = 0; i < col.Count; i++)\r\n                {\r\n                    RelationshipBO rel = col[i];\r\n                    if (rel.IsSelected)\r\n                    {\r\n                        col.Remove(rel);\r\n                        i -= 1; // here, col.Count remains the same before the Remove and the loop never ends.\r\n                    }\r\n                }"},"comment":{"url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/comments/146416747","html_url":"https://github.com/MarimerLLC/cslaforum/issues/65#issuecomment-146416747","issue_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/65","id":146416747,"user":{"login":"rockfordlhotka","id":2333134,"avatar_url":"https://avatars.githubusercontent.com/u/2333134?v=3","gravatar_id":"","url":"https://api.github.com/users/rockfordlhotka","html_url":"https://github.com/rockfordlhotka","followers_url":"https://api.github.com/users/rockfordlhotka/followers","following_url":"https://api.github.com/users/rockfordlhotka/following{/other_user}","gists_url":"https://api.github.com/users/rockfordlhotka/gists{/gist_id}","starred_url":"https://api.github.com/users/rockfordlhotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockfordlhotka/subscriptions","organizations_url":"https://api.github.com/users/rockfordlhotka/orgs","repos_url":"https://api.github.com/users/rockfordlhotka/repos","events_url":"https://api.github.com/users/rockfordlhotka/events{/privacy}","received_events_url":"https://api.github.com/users/rockfordlhotka/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T04:30:16Z","updated_at":"2015-10-08T04:30:16Z","body":"`DynamicListBase` exists entirely for the purpose of supporting a dynamically edited datagrid in a smart client scenario (Windows Forms or WPF). \r\n\r\nIt isn't intended for use via code.\r\n\r\nCan you describe the scenario - why are you interacting with the collection via code instead of binding it to a datagrid?"}}