<?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>Search results matching tag 'Data binding'</title><link>http://forums.lhotka.net/search/SearchResults.aspx?a=0&amp;o=DateDescending&amp;tag=Data+binding&amp;orTags=0</link><description>Search results matching tag 'Data binding'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP3 (Build: 36.8414)</generator><item><title>Re: Edit Level mismatch error</title><link>http://forums.lhotka.net/forums/p/11073/51470.aspx#51470</link><pubDate>Fri, 20 Jan 2012 16:56:55 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:51470</guid><dc:creator>RockfordLhotka</dc:creator><description>&lt;p&gt;Windows Forms data binding is very particular about following its rules. And so is CSLA. The rules are relatively straightforward, but you can&amp;#39;t deviate.&lt;/p&gt;
&lt;p&gt;The primary rule: every beginedit must have a corresponding canceledit/endedit on each object (parent, child, etc).&lt;/p&gt;
&lt;p&gt;Edit level mismatch occurs because some object in the object graph didn&amp;#39;t get a canceledit/endedit call. The most common reason is that the object wasn&amp;#39;t properly unbound from the UI prior to saving.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;Using CSLA .NET 3.0&lt;/em&gt; ebook has pretty extensive coverage of Windows Forms data binding and how to make it work correctly.&lt;/p&gt;</description></item><item><title>Re: BusinessListBase vs BusinessBindingListBase</title><link>http://forums.lhotka.net/forums/p/9008/48731.aspx#48731</link><pubDate>Fri, 27 May 2011 16:19:35 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:48731</guid><dc:creator>RockfordLhotka</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Tiago Freitas Leal&amp;quot;]
&lt;p&gt;Besides sharing the experience, I think&amp;nbsp;this also&amp;nbsp;raises a point. If we must use&amp;nbsp;&lt;strong&gt;BusinessBindingListBase&lt;/strong&gt;&amp;nbsp;for Windows Forms and&amp;nbsp;&lt;strong&gt;BusinessListBase&lt;/strong&gt;&amp;nbsp;for WPF/Silverlight, suppose my application has both clients. I need to have duplicated Business*ListBase classes?&lt;/p&gt;
&lt;div style="CLEAR:both;"&gt;&lt;/div&gt;
[/quote]&lt;/p&gt;
&lt;p&gt;Yes, if you have one business DLL that is used by Windows Forms and WPF UI elements in the same app, then you probably have to create duplicated collection classes.&lt;/p&gt;
&lt;p&gt;In my observation, this normally happens when an org has a Windows Forms app, and they migrate to WPF over a period of months or years. So the same app is running some WinForms and some WPF, often using Microsoft&amp;#39;s interop capabilities.&lt;/p&gt;
&lt;p&gt;My recommendation is to port logical units of functionality from WinForms to WPF, one unit at a time. This way you can port a number of forms to WPF, and can port the related business types as well.&lt;/p&gt;
&lt;p&gt;This won&amp;#39;t eliminate the need for some duplicate collection types, but it can help reduce the number of duplicates.&lt;/p&gt;
&lt;p&gt;The real key is to minimize the number of duplicated &lt;em&gt;editable list types&lt;/em&gt;. Read-only lists that subclass ReadOnlyListBase usually work fine in WinForms, because none of the &amp;quot;missing&amp;quot; features are used against a read-only list. Only editable lists are problematic.&lt;/p&gt;</description></item><item><title>Strange behaviour of datagridview binded to sortedbindinglist</title><link>http://forums.lhotka.net/forums/p/10277/48161.aspx#48161</link><pubDate>Tue, 19 Apr 2011 14:07:54 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:48161</guid><dc:creator>Niemand</dc:creator><description>&lt;p&gt;I encountered strange behavior of datagridview:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the parent object &amp;nbsp;(invoice) I have a childlist (invoiceitemlist) that I expose through a property like this:&lt;/p&gt;
&lt;p&gt;Public ReadOnly Property InvoiceItemList() As Csla.SortedBindingList(Of InvoiceItem)&lt;br /&gt;&amp;nbsp;        &amp;nbsp;Get&lt;br /&gt;&amp;nbsp;               &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return _InvoiceItemList.GetSortedList&lt;br /&gt;&amp;nbsp;           &amp;nbsp;End Get&lt;br /&gt;        End Property&lt;/p&gt;
&lt;p&gt;Adequate method in childlist is:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;lt;NonSerialized()&amp;gt; _&lt;br /&gt;        Private _SortedList As Csla.SortedBindingList(Of InvoiceItem) = Nothing&lt;/p&gt;
&lt;p&gt;Public Function GetSortedList() As Csla.SortedBindingList(Of InvoiceItem)&lt;br /&gt;&amp;nbsp;           &amp;nbsp; &amp;nbsp;If _SortedList Is Nothing Then _SortedList = New Csla.SortedBindingList(Of InvoiceItem)(Me)&lt;br /&gt;&amp;nbsp;           &amp;nbsp; &amp;nbsp;Return _SortedList&lt;br /&gt;        End Function&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Binding is implemented by VS GUI (draging form datasources).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also have the same implementation (with private field) of exposing SBL in parentrootlist.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But in the first case databinding cancelnew method &amp;nbsp;wouldn&amp;#39;t work and in the second case it works perfectly. What could be a reason for that?&lt;/p&gt;</description></item><item><title>Re: IdentityConverter and CSLA Silverlight</title><link>http://forums.lhotka.net/forums/p/10240/48004.aspx#48004</link><pubDate>Wed, 06 Apr 2011 14:48:57 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:48004</guid><dc:creator>RockfordLhotka</dc:creator><description>&lt;p&gt;WPF 3.5 introduced a binding option that solves this problem, so I removed IdentityConverter from CSLA at that point. I don&amp;#39;t recall the specific binding option off the top of my head, but there&amp;#39;s a way to tell the binding to always refresh.&lt;/p&gt;
&lt;p&gt;To my knowledge, Silverlight never had this same issue, I think it was only a WPF binding problem.&lt;/p&gt;</description></item><item><title>IdentityConverter and CSLA Silverlight</title><link>http://forums.lhotka.net/forums/p/10240/48003.aspx#48003</link><pubDate>Wed, 06 Apr 2011 12:24:20 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:48003</guid><dc:creator>MichaelMaddox</dc:creator><description>&lt;p&gt;There is a blog post by Rocky here talking about IdentityConverter and WPF:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lhotka.net/weblog/DataBindingIssueInWPFWithSolution.aspx"&gt;http://www.lhotka.net/weblog/DataBindingIssueInWPFWithSolution.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Csla.Wpf namespace in CSLA 3.8 contains the&amp;nbsp;IdentityConverter class.&lt;/p&gt;
&lt;p&gt;In CSLA 4.1, the Csla.Xaml namespace for Silverlight does not appear to contain the&amp;nbsp;IdentityConverter class and this is the only forum post I can find mentioning&amp;nbsp;IdentityConverter and Silverlight, but the issue appears to remain unsolved:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://forums.lhotka.net/forums/p/8282/39434.aspx"&gt;http://forums.lhotka.net/forums/p/8282/39434.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m porting a WPF CSLA 3.8 project to Silverlight CSLA 4.1 and I&amp;#39;m having issues with databinding and I&amp;#39;m not sure if the lack of&amp;nbsp;IdentityConverter could be causing the issue. &amp;nbsp;Thoughts?&lt;/p&gt;
&lt;p&gt;-Michael&lt;/p&gt;</description></item><item><title>WinForm binding combo box</title><link>http://forums.lhotka.net/forums/p/10218/47915.aspx#47915</link><pubDate>Tue, 29 Mar 2011 18:28:25 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:47915</guid><dc:creator>sjsmith</dc:creator><description>&lt;p&gt;I&amp;#39;m trying to implement a solution using the CSLA 4 framework with a WinForm interface.&amp;nbsp; I have a BusinessBase class that represents an address.&amp;nbsp; The address class has an editable property for State and County, and read-only lists for States and Counties.&amp;nbsp; The goal is to have the class refresh the list of counties each time the State property changes.&amp;nbsp; This way the&amp;nbsp;CountyList contains a list of counties for the current state.&amp;nbsp; Using the code below, I&amp;#39;m able to make the class rebuild the CountyList each time the State property changes.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;Public Shared ReadOnly StateProperty As PropertyInfo(Of String) = RegisterProperty(Of String)(Function(c) c.State, &amp;quot;State&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Property State() As String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return GetProperty(StateProperty)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set(ByVal value As String)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetProperty(StateProperty, value)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetProperty(CountyProperty, vbNullString)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetProperty(CountyListProperty, CountyLst.GetList(Me.DatabaseID, Me.State))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#000000;"&gt;I&amp;#39;m new to the data binding framework and can not figure out how to have the address class notify the WinForm&amp;nbsp;interface that it needs to rebuild (or refresh) the data source of the CountyListBindingSource.&amp;nbsp;Setting the CountyListProperty in the code above, does not trigger an event that I can capture on the interface.&amp;nbsp; It would seem that I&amp;#39;m missing something simple (method or event) that is available to me to make this happen.&amp;nbsp; Any suggestions for a newbie?&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:x-small;font-family:Consolas;"&gt;Thanks.&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="font-size:x-small;color:#0000ff;font-family:Consolas;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>CSLA Databinding with mono</title><link>http://forums.lhotka.net/forums/p/10207/47866.aspx#47866</link><pubDate>Sat, 26 Mar 2011 17:06:42 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:47866</guid><dc:creator>TygreWolf</dc:creator><description>&lt;p&gt;Hey guys,&lt;br /&gt;&lt;br /&gt;So I&amp;#39;ve been working on a project using the latest CSLA from the SVN.&amp;nbsp; I have it compiled and it seems to be working on Mono quite well except with one issue - databinding.&amp;nbsp; Binding CSLA objects to comboboxes and datagridviews works just as it should in Windows Forms (using BusinessBindingListBase and the .NET Framework), but once run in Mono (Windows or Linux), databinding craps out.&amp;nbsp; Datagridviews do not get populated with data, and comboboxes act extremely flaky.&lt;br /&gt;&lt;br /&gt;The general rule is that if it works in Windows and doesn&amp;#39;t work in Mono, then it&amp;#39;s a Mono bug.&amp;nbsp; Fair enough.&amp;nbsp; Is there another alternative for databinding the business objects to the form that might work relatively well in Mono (aside from just manually populating the controls with data) that I might be overlooking?&lt;br /&gt;&lt;br /&gt;Simply enough, I&amp;#39;m just using a Windows BindingSource object, and setting its datasource to my business objects when the form loads (with the occassional BindingSource.ResetBindings(false) methodcall). The form controls are just bound to the BindingSource.&lt;br /&gt;&lt;br /&gt;Thanks for any advice.&lt;br /&gt;&lt;br /&gt;-Jason&lt;/p&gt;</description></item><item><title>Two BindingSources with the Same DataSource Type</title><link>http://forums.lhotka.net/forums/p/10050/47157.aspx#47157</link><pubDate>Wed, 09 Feb 2011 21:06:58 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:47157</guid><dc:creator>shaselsc</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Two different combo boxes for a C# WinForms application that need to have a list of the same data. They need to be able to have different values at any given time, so they can&amp;#39;t use the same BindingSource. I have a NameValueList business object that has an ID(Key) and Name(Value). I want to set the BindingSource to the same type of business object. When using the Visual Studio 2010 GUI to achieve this, the first one works correctly, but after adding the second and setting it to the NameValueList business object, I get a rather strange runtime error: &amp;quot;DataMember property &amp;#39;Position&amp;#39; cannot be found on the DataSource.&amp;quot; It happens on this line of code in the Designer code file for the form:&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;((System.ComponentModel.ISupportInitialize)(this.associateListBindingSource)).EndInit();&lt;/p&gt;
&lt;p&gt;Is there a way to get around this or am I going about this the wrong way?&lt;/p&gt;
Thanks,&lt;br /&gt;Steve
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/p&gt;</description></item><item><title>Problems with Begin- / Cancel- / Apply-Edit operations </title><link>http://forums.lhotka.net/forums/p/9853/46216.aspx#46216</link><pubDate>Fri, 10 Dec 2010 12:30:59 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:46216</guid><dc:creator>DeepCore</dc:creator><description>&lt;p&gt;Hello community!&lt;/p&gt;
&lt;p&gt;I&amp;#39;m lost with the undo capabilities of CSLA. I have found several questions/answers dealing with the strange behavior of data binding under windows forms.&lt;/p&gt;
&lt;p&gt;But alas, I&amp;#39;m not using data binding at all in my test application. I&amp;#39;m using CSLA 3.8.4, C#, .NET 3.5SP1, VS2010, NHibernate with Fluent-NHibernate.&lt;/p&gt;
&lt;p&gt;I have built the following business objects:&lt;/p&gt;
&lt;p&gt; User object with 4 properties: UserID, FirstName, LastName and Role&lt;br /&gt;UserRole object with 2 properties: ID and Description.&lt;/p&gt;
&lt;p&gt;So far so good, I am able to persist these objects in the SQLite-DB. &lt;img src="http://forums.lhotka.net/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then I reload one user object from the DB, call .BeginEdit on it and assign another UserRole to the Role property ...&lt;/p&gt;
&lt;p&gt;Afterwards I call .CancelEdit, expecting my user object&amp;#39;s role property would revert to it&amp;#39;s state before the .BeginEdit call ...&lt;/p&gt;
&lt;p&gt;But that&amp;#39;s not the case &lt;img src="http://forums.lhotka.net/emoticons/emotion-9.gif" alt="Crying" /&gt;&lt;/p&gt;
&lt;p&gt;What am I doing wrong ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Seasons greetings&lt;/p&gt;
&lt;p&gt;Philippe&lt;/p&gt;</description></item><item><title>Re: How can i change the controls error state while running the business rules manually</title><link>http://forums.lhotka.net/forums/p/9745/45840.aspx#45840</link><pubDate>Fri, 12 Nov 2010 02:35:34 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:45840</guid><dc:creator>RockfordLhotka</dc:creator><description>&lt;p&gt;After calling CheckRules, make a call to OnUnknownPropertyChanged - that will raise appropriate PropertyChanged events and should get you the desired result.&lt;/p&gt;</description></item></channel></rss>