in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1DataSet with DataLibrary Does Not Fire PositionChanged Event

Last post 10-01-2007 4:15 PM by rolandhordos. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-16-2006 1:25 PM

    C1DataSet with DataLibrary Does Not Fire PositionChanged Event

    Hi,
     
    Using C1DataSet .NET 2 I never see the PositionChanged event fired.  The DataSet is primarily used for a master-detail relationship in a DataLibrary.  Using db navigator or changing rows in the master DBGrid does not fire the PositionChanged event.
     
    The DataSet is connected to the DataLibrary and otherwise functions perfectly with the DBGrid and DBDropDowns.  The DataLibrary documentation says a DataSet can be accessed directly or indirectly.  I'm directly using the PositionChanged event.
     
    Am I missing something or does this event just not work with a tiered architecture?
     
    thanks, Roland;
  • 11-16-2006 3:51 PM In reply to

    Re: C1DataSet with DataLibrary Does Not Fire PositionChanged Event

    Hi Roland,
     
    I don't see this problem. Could you please take a look at the attached
    sample application. I have also tried the CurrentRowChanged event.
    This event is fired for a detail table when the user changes the current
    row in a master table. The PositionChanged event is not fired in that
    case because the current position is not changed in the detail table.
     
    Regards,
     
    -Andrey
     
    <rolandhordos> wrote in message news:188881@test.componentone.com...
    Hi,
     
    Using C1DataSet .NET 2 I never see the PositionChanged event fired.  The DataSet is primarily used for a master-detail relationship in a DataLibrary.  Using db navigator or changing rows in the master DBGrid does not fire the PositionChanged event.
     
    The DataSet is connected to the DataLibrary and otherwise functions perfectly with the DBGrid and DBDropDowns.  The DataLibrary documentation says a DataSet can be accessed directly or indirectly.  I'm directly using the PositionChanged event.
     
    Am I missing something or does this event just not work with a tiered architecture?
     
    thanks, Roland;


    http://home.componentone.com/cs/forums/188881/ShowPost.aspx

  • 04-16-2007 4:41 AM In reply to

    • Ranco
    • Not Ranked
    • Joined on 03-06-2006
    • Posts 6

    Re: C1DataSet with DataLibrary Does Not Fire PositionChanged Event

    Hi, I have exactly the same Problem.

    So I have tested different Scenarios, and expect the following:
    In Version 2.0.20061.159 of c1.data.2.dll
    everything works fine the position changed event will be fired.

    In the curent Version 2.0.20071.180 the Position Changed Event will NOT be fired.

    I was wondering so i try something out and here is the Result.

    If I have the Control that changes the Position in the Dataset placed WITHIN an other Control - for example the TabControl or the Sizer Control. The Event will NOT be fired. If I place the Cotnrol directly on the Form it will be fired.

    In Version 61.159 it will be fired in both cases, since Version ?? until the currrent 71.180 it will only be fired if I place the Position Changing Control DIRECT on the Form. So I Think this is a BUG ?
  • 10-01-2007 4:09 PM In reply to

    Re: C1DataSet with DataLibrary Does Not Fire PositionChanged Event

    I never noticed this response until now.  It is in VB and I never develop with VB.  Please test it with a C# VS 2005 environment (Pro or Express).

    I have recently updated all components, now on a different workstation as well, and I still have this problem though I now have much more information on how to recreate the issue as well as a workaround.  See my new incident submission dated today titled "C# .NET2, DataLibrary, Multiple C1DataSet, BindingContextCtrl Not Set or Handled Correctly in VS2005 Designer, Workaround" for details.

  • 10-01-2007 4:15 PM In reply to

    Re: C1DataSet with DataLibrary Does Not Fire PositionChanged Event

    For convenience I'll cross-post the updated problem and workaround, to hopefully save time for others who've wasted hours on this problem:

    With Multiple C1DataSet objects on a form in VS 2005, the BindingContext becomes corrupted  ...  If you then comment out the initialization line for the working dataset (ex:  "this.c1DataSet1.BindingContextCtrl = this;") you will find the PositionChanged event now works for dataset 2 but of course stops working for dataset 1.  The components and the designer never create properly working code ...  The following workaround is the only way I've found that it works, providing proper PositionChanged event firing for both datasets: 

    Workaround
    Step 1)  In the form, manually declare and create separate BindingContext objects:

     BindingContext bcG1 = new BindingContext();
     BindingContext bcG2 = new BindingContext();

    Step 2)  After the InitializeComponent method in the form's constructor, manually assign all data aware components to their respective binding contexts (on a complex form .. yeesh this is annoying and prone to maintenance hassles).

     c1TrueDBGrid1.BindingContext = bcG1;
     c1TrueDBGrid2.BindingContext = bcG2;
     c1DataSet1.BindingContext = bcG1;
     c1DataSet2.BindingContext = bcG2;

    Additional Observations
    I believe other events such as CurrentRowChanged are affected by this as well (and corrected with the workaround), though I've focused my testing on the PositionChanged event.

    Could not produce a solution using BindingSource objects, in this case none of the BindingSource objects fired their PositionChanged events though the components allow linking through to the DataSet and DataMember within the designer, and data shows up at runtime.  Searching the DataObjects help file for "BindingSource" or "BindingContext" gives 0 results.  I'm really surprised this has not been documented nor tested (or should show in Release notes as a known issue).

Page 1 of 1 (5 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.