<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.lhotka.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CSLA .NET discussion</title><link>http://forums.lhotka.net/forums/5.aspx</link><description>General discussion about CSLA .NET</description><dc:language /><generator>CommunityServer 2008.5 SP3 (Build: 36.8414)</generator><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/52640.aspx</link><pubDate>Fri, 27 Apr 2012 00:01:58 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:52640</guid><dc:creator>Michael</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/52640.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=52640</wfw:commentRss><description>&lt;p&gt;Fantastic, thanks Jonny!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/52636.aspx</link><pubDate>Thu, 26 Apr 2012 09:35:38 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:52636</guid><dc:creator>JonnyBee</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/52636.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=52636</wfw:commentRss><description>&lt;p&gt;For Windows Forms with CSLA 4.3 you must change to use the BindingList derived base class:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;b&gt;ReadOnlyBindingListBase &lt;/b&gt;&lt;/i&gt;and&lt;br /&gt;&lt;i&gt;&lt;b&gt;BusinessListBindingListBase&amp;nbsp; etc&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;The ReadOnlyListBase and BusinessListBase is now derived from ObservableCollection that does not work properly with Windows Forms.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/52635.aspx</link><pubDate>Thu, 26 Apr 2012 08:58:12 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:52635</guid><dc:creator>Michael</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/52635.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=52635</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve spent the last few days upgrading our projects from CSLA 3.8 to 4.3. Sadly, all of our selectable ReadOnlyBase / ReadOnlyListBase collections bound to WinForms DataGridViews are broken. When I first asked this question, the problem was in the ROLB; binding to a plain List&amp;lt;T&amp;gt; of ROB behaved correctly. However,&amp;nbsp; with 4.3 even binding to a plain List does not work. So, that makes me wonder if the problem is in ROB.&lt;/p&gt;
&lt;p&gt;When programatically changing the Selected field for all items, only the binding source&amp;#39;s current item responds to the OnPropertyChanged (the check box for the current row is updated correctly). No other rows respond. When a different row is clicked, its check box is updated. So, what&amp;#39;s different?&lt;/p&gt;
&lt;p&gt;I know this is an old thread, so If I don&amp;#39;t get any help here I&amp;#39;ll start a new one.&lt;/p&gt;
&lt;p&gt;Regards&lt;br /&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/33859.aspx</link><pubDate>Wed, 10 Jun 2009 03:27:33 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:33859</guid><dc:creator>Michael</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/33859.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=33859</wfw:commentRss><description>&lt;font face="Arial"&gt;&lt;font size="2"&gt;Setting &lt;font face="Courier New"&gt;ROLB.AllowEdit = true&lt;/font&gt; is all that's required. Thanks for your help.&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/33857.aspx</link><pubDate>Wed, 10 Jun 2009 02:56:04 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:33857</guid><dc:creator>SonOfPirate</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/33857.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=33857</wfw:commentRss><description>&lt;P&gt;Your problem is most likely caused by the fact that the ReadOnlyListBase or, more specifically, the Core.ReadOnlyBindingList class it inherits is marked as read-only be default.&amp;nbsp; When you bind the object to a UI control, such as a DataGrid, the control looks at the IBindingList interface&amp;nbsp;to determine what behaviors are supported.&amp;nbsp; This includes the IsReadOnly property (from IList) as well as AllowEdit, AllowNew and AllowRemove.&amp;nbsp; The latter three are set to false by default.&lt;/P&gt;
&lt;P&gt;If you want a control to allow users to toggle your Selected property, you'll need to either override the AllowEdit property&amp;nbsp;or set it to true in your constructor.&amp;nbsp; I believe you may also need to change IsReadOnly to false, but try changing AllowEdit first to be sure.&amp;nbsp; You will most likely need to apply the Bindable attribute to your business object so that other properties can't be edited in the UI.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/33852.aspx</link><pubDate>Tue, 09 Jun 2009 22:14:04 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:33852</guid><dc:creator>Michael</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/33852.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=33852</wfw:commentRss><description>&lt;font size="2" face="Arial"&gt;&lt;span&gt;ROB already implements INotifyProopertyChanged in Csla.Core.BindableBase (if it didn't the code I posted would not build).&lt;br&gt;&lt;br&gt;I tried a List&amp;lt;ROB&amp;gt; and that does indeed work, so ROL must be breaking it somehow.&lt;br&gt;&lt;br&gt;Is this "by design"? (Rocky?) Is there a workaround? I'd obviously prefer to use ROL rather than plain List.&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;Michael&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/33847.aspx</link><pubDate>Tue, 09 Jun 2009 18:02:46 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:33847</guid><dc:creator>tetranz</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/33847.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=33847</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;sergeyb:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Yes.&amp;nbsp;
You need to implement INotifyProopertyChanged interface inside your ROB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;



&lt;p class="MsoNormal"&gt;&lt;span&gt;ROBInstance:
BB&amp;lt; ROBInstance&amp;gt;, INotifyPropertyChanged&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Yeah but I don't think lack of INotifyPropertyChanged explains why Michael's set code never runs. It means that the UI won't automatically know about the change if the property is updated in code. I've done something similar, blurring the definition of read only so I don't know why it's not working. I can bind any plain old object to a grid and the properties get updated (i.e, set runs) when edited in the grid.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Have you tried a simple List&amp;lt;ROB&amp;gt; or even an array? Does the set work then? That would indicate whether or not it's really related to the ROL or something else.&lt;br&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/33840.aspx</link><pubDate>Tue, 09 Jun 2009 12:45:15 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:33840</guid><dc:creator>sergeyb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/33840.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=33840</wfw:commentRss><description>&lt;div class=Section1&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;Yes.&amp;nbsp;
You need to implement INotifyProopertyChanged interface inside your ROB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;ROBInstance:
BB&amp;lt; ROBInstance&amp;gt;, INotifyPropertyChanged&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span&gt;Sergey Barskiy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;i&gt;&lt;span&gt;Principal Consultant&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;office: 678.405.0687 |
mobile:&amp;nbsp;404.388.1899&lt;/span&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;img width=119 height=26 id="Picture_x0020_1" alt="cid:_2_0648EA840648E85C001BBCB886257279"&gt;&lt;br&gt;
&lt;/span&gt;&lt;b&gt;&lt;span&gt;Microsoft Worldwide Partner of the Year |&lt;/span&gt;&lt;/b&gt;&lt;span&gt; &lt;/span&gt;&lt;b&gt;&lt;span&gt;Custom
Development Solutions, Technical Innovation&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;div&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span&gt;From:&lt;/span&gt;&lt;/b&gt;&lt;span&gt; Michael
[mailto:cslanet@lhotka.net] &lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Tuesday, June 09, 2009 12:01 AM&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; Sergey Barskiy&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; [CSLA .NET] Selectable read only objects&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span&gt;I
often need to bind a ROL of ROB to a WinForms grid with the ability to select
items via a CheckBoxColumn. The set in the following property never gets hit
when the cell is clicked:&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;span&gt;bool
m_selected;&lt;br&gt;
public bool Selected&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return m_selected; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_selected = value;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
OnPropertyChanged(&amp;quot;Selected&amp;quot;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
}&lt;/span&gt;&lt;span&gt;&lt;br&gt;
&lt;br&gt;
The code does work if the ROB is change to a BB. Has anyone else tried
something like this?&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
Michael&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Selectable read only objects</title><link>http://forums.lhotka.net/forums/thread/33839.aspx</link><pubDate>Tue, 09 Jun 2009 04:00:18 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:33839</guid><dc:creator>Michael</dc:creator><slash:comments>0</slash:comments><comments>http://forums.lhotka.net/forums/thread/33839.aspx</comments><wfw:commentRss>http://forums.lhotka.net/forums/commentrss.aspx?SectionID=5&amp;PostID=33839</wfw:commentRss><description>&lt;font size="2" face="Arial"&gt;I often need to bind a ROL of ROB to a WinForms grid with the ability to select items via a CheckBoxColumn. The set in the following property never gets hit when the cell is clicked:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;bool m_selected;&lt;br&gt;public bool Selected&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return m_selected; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_selected = value;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnPropertyChanged("Selected");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;br&gt;&lt;br&gt;The code does work if the ROB is changed to a BB, or by making it a non-CSLA object that implements INotifyPropertyChanged. Has anyone else tried something like this?&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;Michael&lt;/font&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>