﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Grid Refresh -Binding Error</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 21 May 2026 12:51:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17206.aspx</link><description>I have list of services (Object) in my grid.&amp;nbsp;I've added a record (Services Object) on different page.&amp;nbsp;Then, refresh the grid when I came to Grid page. I have got the error below.&lt;/P&gt;&lt;P&gt;An error occurred while refreshing the data from field 'Services.unitset_id' to property 'SelectedValue' on control 'editUnitSet.'&lt;/P&gt;&lt;P&gt;When I open the&amp;nbsp;page from menu. I have seen the added record.</description><pubDate>Wed, 09 Jul 2008 07:59:59 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17730.aspx</link><description>OK...that makes more sense.</description><pubDate>Wed, 09 Jul 2008 07:59:59 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17727.aspx</link><description>I've developed a test a project. And seen that no problem at that case. &lt;/P&gt;&lt;P&gt;Original point in my project also have been tested and also no problem.&lt;/P&gt;&lt;P&gt;The problem may be related development environment (DLL versions etc).</description><pubDate>Wed, 09 Jul 2008 03:39:17 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17705.aspx</link><description>Ertan,&lt;/P&gt;&lt;P&gt;I don't see anything past an invalid cast exception.&amp;nbsp; Why can't you just return an alternate value on Null so that a valid value is returned to the grid?&amp;nbsp; I do not believe this to be a BBS or BO "bug" or "issue" but rather how it is designed.&amp;nbsp; If the control to which you are binding doesn't support a null value being returned, then you would want to ensure that it can be cast by supplying a valid value.&amp;nbsp; Just from looking at your code snippet and stack trace, this is what I would recommend.</description><pubDate>Tue, 08 Jul 2008 09:43:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17696.aspx</link><description>&lt;FONT color=#111111&gt;I think there is conflict or complication. What do you&amp;nbsp;say the conflict with the message and code ?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;The line from my code shows that unitset_id gets value.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;((Services)component).unitset_id = (Nullable&amp;lt;System.Int32&amp;gt;&lt;IMG title=Wink src="http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Wink.gif" align=absMiddle border=0&gt;Value; (Error : Specified Cast is not valid.)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;But message says&amp;nbsp; control gets value ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;"An error occurred while refreshing the data from field 'Services.unitset_id' to property 'SelectedValue' on control 'editUnitSet.'"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#dd1111&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR&gt;</description><pubDate>Tue, 08 Jul 2008 01:03:59 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17647.aspx</link><description>I have not had a change to look at this in depth.&amp;nbsp; I tried to re-produce the problem quickly, but had no issues.&amp;nbsp; Since I am going to have to take your code and try and reconstruct your issue, I have not had a chance to do this.&amp;nbsp; If you want to supply the sample, it may go faster.&amp;nbsp; But as of yet, I have not been able to reproduce nor have I spent an extended amount of time trying to reproduce since I couldn't reproduce it quickly.&lt;P&gt;So at present, this is on a list to look at, and it is something that we will try to look at prior to the final 1.6.6 build.&amp;nbsp; If you want to provide a sample showing the error versus just showing a code snippet, it will definitely speed up the process.</description><pubDate>Sun, 06 Jul 2008 17:32:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17629.aspx</link><description>Any Comment ?</description><pubDate>Fri, 04 Jul 2008 00:34:46 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17521.aspx</link><description>As a described above,&amp;nbsp;I fill the object&amp;nbsp;and get a list of records in the grid and current record on the form view. (UI controls)&amp;nbsp;I couldn't get the error. Values are coming from DB and displayed on the form. (I don't have the error)&lt;/P&gt;&lt;P&gt;But, Requery object and no records. This is also working.&lt;/P&gt;&lt;P&gt;Requery object but there are records at this time. I 've got the error.</description><pubDate>Wed, 02 Jul 2008 01:54:33 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17520.aspx</link><description>I've attached the code clock below. I'm trying to fill the object. (FillDataTable) At this time, &lt;BR&gt;SetValue is running and I'm gettinng the error. (It is signed with red on the code block.) &lt;BR&gt;It is interesting that left side of the assignment has a value (valid unitsetid) but right side has null value. &lt;BR&gt;So, casting error. The object has values coming from DB. But there is an assignment (SetValue) which is trying &lt;BR&gt;to assign values on the object which is filled. Normally, After object has values coming from DB, binding mechanism will start. &lt;BR&gt;Why does SetValue run at this time ? What is the meaning of SetValue ? &lt;/P&gt;&lt;P&gt;Is the order of assignment true ? I expect that right side must be left side ? Because, I'm displaying values from DB.&lt;/P&gt;&lt;P&gt;Do you explain the process briefly ? Fill, Bind etc.&lt;/P&gt;&lt;P&gt;private class Field_unitset_id_Descriptor : MicroFour.StrataFrame.Business.FieldPropertyDescriptor&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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; public Field_unitset_id_Descriptor() : base("unitset_id") { }&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; private System.Type _PropertyType = typeof(System.Int32);&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; public override object GetValue(Object component)&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ((Services)component).unitset_id;&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; }&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; public override void SetValue(Object component, object Value)&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#dd1111&gt;((Services)component).unitset_id = (Nullable&amp;lt;System.Int32&amp;gt;)Value; (Error : Specified Cast is not valid.)&lt;/FONT&gt;&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; }&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; public override System.Type PropertyType&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; {&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this._PropertyType;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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; }&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; public override System.Type ComponentType&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; {&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _ComponentType;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }</description><pubDate>Wed, 02 Jul 2008 01:46:00 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17483.aspx</link><description>Well, there seems to be quite&amp;nbsp;a bit going on, but the last error seems to be the easiest to dianose.&amp;nbsp; It is a cast exception so that value that is being passing into the Set of the unitset_id field is not a type that can be converted into the type it is expecting.&amp;nbsp; For example, this may be a integer field and character data is being passed into the Set of the property.</description><pubDate>Tue, 01 Jul 2008 09:08:27 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17482.aspx</link><description>The error was related the parameters given in Listpopulating Event. Null control&amp;nbsp; was missing. Now, when BusinessObject has no records, I'm not getting the&amp;nbsp;error specified. I 've continued working on the form ;&lt;/P&gt;&lt;P&gt;I 've requeried the object (which is bound to the grid and UI controls which show current object) with parameters that returns records . Object had records after query. I've got the new error. (See details)&lt;/P&gt;&lt;P&gt;Type : System.InvalidCastException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;BR&gt;Message : Specified cast is not valid.&lt;BR&gt;Source : Medin.Business.Materials.New&lt;BR&gt;HelpLink : &lt;BR&gt;TargetSite : Void SetValue(System.Object, System.Object)&lt;BR&gt;StackTrace : &lt;BR&gt;&amp;nbsp;Medin.Business.Materials.Purchase.Services.Field_unitset_id_Descriptor.SetValue(Object component, Object Value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;C:\Documents and Settings\ertan.deniz.KULLANICI\My Documents\Visual Studio 2005\Projects\Medin.Materials\Medin.Materials.Purchase.Business\Purchase\Objects\Services.Designer.cs:line 1235&lt;BR&gt;&amp;nbsp;System.Windows.Forms.BindToObject.SetValue(Object value)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.Binding.PullData(Boolean reformat, Boolean force)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.Binding.UpdateIsBinding()&lt;BR&gt;&amp;nbsp;System.Windows.Forms.Binding.CheckBinding()&lt;BR&gt;&amp;nbsp;System.Windows.Forms.Binding.SetListManager(BindingManagerBase bindingManagerBase)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.ListManagerBindingsCollection.AddCore(Binding dataBinding)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.BindingsCollection.Add(Binding binding)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.BindingContext.UpdateBinding(BindingContext newBindingContext, Binding binding)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.Binding.SetBindableComponent(IBindableComponent value)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.ControlBindingsCollection.AddCore(Binding dataBinding)&lt;BR&gt;&amp;nbsp;System.Windows.Forms.ControlBindingsCollection.Add(Binding binding)&lt;BR&gt;&amp;nbsp;MicroFour.StrataFrame.Business.BusinessLayer.AddBinding(Control ControlToRefresh, String PropertyName, String FieldName)&lt;BR&gt;&amp;nbsp;MicroFour.StrataFrame.Business.BusinessLayer.RefreshControl(IBusinessBindable ControlToRefresh, Boolean DataPresent)</description><pubDate>Tue, 01 Jul 2008 08:05:13 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17470.aspx</link><description>Stack Trace of the above error :&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp;amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)&lt;/P&gt;&lt;P&gt;at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)&lt;/P&gt;&lt;P&gt;at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)&lt;/P&gt;&lt;P&gt;at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)&lt;/P&gt;&lt;P&gt;at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)&lt;/P&gt;&lt;P&gt;at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)&lt;/P&gt;&lt;P&gt;at MicroFour.StrataFrame.Business.BusinessLayer.RemoveBinding(Control ControlToRefresh, String PropertyName)&lt;/P&gt;&lt;P&gt;at MicroFour.StrataFrame.Business.BusinessLayer.RefreshControl(IBusinessBindable ControlToRefresh, Boolean DataPresent)&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 30 Jun 2008 06:19:37 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17469.aspx</link><description>I've encountered&amp;nbsp;with same error. &lt;/P&gt;&lt;P&gt;In my form ; There is a grid which lists the objects (called Services).&lt;/P&gt;&lt;P&gt;and There are UI controls which shows the current object's properties. (Current object is selected on the grid.)&lt;/P&gt;&lt;P&gt;If Business Object has no records. (After a query) I've got the error below ;&lt;/P&gt;&lt;P&gt;"An error occurred while refreshing the data from field 'Services.unitset_id' to property 'SelectedValue' on control 'editUnitSet.'"&lt;/P&gt;&lt;P&gt;editUnitSet is a combobox and populated on formload from another Business Object. Since Business Object (Services Object) has no current record, and has no valid unitset_id as well. Binding mechanism goes on working.&lt;/P&gt;&lt;P&gt;I've searched from help and found the topic ;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#dd1111&gt;&lt;FONT color=#111177&gt;What Happens to an Empty Business Object&lt;/FONT&gt;&lt;BR&gt;StrataFrame automatically removes all control bindings when the business object has no records.&amp;nbsp; &lt;BR&gt;The instant the business object is populated with data, the bindings are automatically re-created and the presentation layer controls are updated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;If so, why do I get the error ? What is wrong with my case ?</description><pubDate>Mon, 30 Jun 2008 06:01:11 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17467.aspx</link><description>Sorry. Last week was my holiday week.&lt;/P&gt;&lt;P&gt;I've tested my screen and I had no error for the above condition.&amp;nbsp;It might be under specific conditions. If I find that&amp;nbsp;case, I 'll inform you. &amp;nbsp;</description><pubDate>Mon, 30 Jun 2008 01:53:32 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: Grid Refresh -Binding Error</title><link>http://forum.strataframe.net/FindPost17236.aspx</link><description>You haven't provided enough information for me to help you diagnose your problem.&amp;nbsp; Please post a stack trace and/or a quick sample that reproduces your problem.&amp;nbsp; Thanks.</description><pubDate>Mon, 23 Jun 2008 08:21:59 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>