The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Entityspaces and infragistics wingrid

Last post 12-04-2007, 6:38 AM by David.Parsons. 18 replies.
Page 2 of 2 (19 items)   < Previous 1 2
Sort Posts: Previous Next
  •  12-03-2007, 7:27 AM 6956 in reply to 6955

    Re: Entityspaces and infragistics wingrid

    If entity is a brand new object, that has no data, and has never been saved, then it has no primary key filled in with which to populate entity.ZColectionByPK.

    Perhaps, if you gave an example of what you are trying to accomplish, using Northwind, we might understand it better. Plus, you have not responded to any of the questions in the previous posts that were trying to help. Can you confirm that you have set the AllowAddNew  override, and that EnableHierarchicalBinding is false?


    David Neal Parsons
    www.entityspaces.net
  •  12-03-2007, 9:37 AM 6958 in reply to 6956

    Re: Entityspaces and infragistics wingrid

    Hi!

    Sorry, I left AllowNew and EnableHierarchicalBinding as default, i tryed set EnableHierarchicalBindind as false, but make no difference. The grid is setted to allow new row (of course).

    A doubt, in what level/collection should I set it?

    Code:
    1    XCollection x = new XCollection();
    2    x.Query.Load();
    3    
    4    if (x.YCollectionByPK.Count == 0) 
    5        entity =   x.YCollectionByPK.AddNew(); // then the issue occurs
    6    else
    7        entity =   x.YCollectionByPK[0]; // not occurs the issue, works perfect
    8    
    9    entity.ZColectionByPK.AllowNew = true;
    10   entity.ZColectionByPK.EnableHierarchicalBinding = false;
    11   
    12   this.bindingSource1.DataSource = entity.ZColectionByPK;
    13   
    14   ultraGrid1.DataSource = bindingSource1;
    


    This is an complex form of my app, where I can add new at XCollection, YCollection and ZCollection, and I cant save at middle.
    Welliton Toledo
  •  12-03-2007, 10:52 AM 6960 in reply to 6958

    Re: Entityspaces and infragistics wingrid

    Hi, here's the northwind equivalent:

    Code:
    1    using System;
    2    using System.Collections.Generic;
    3    using System.ComponentModel;
    4    using System.Data;
    5    using System.Drawing;
    6    using System.Text;
    7    using System.Windows.Forms;
    8    
    9    using Infragistics.Win;
    10   using Infragistics.Win.UltraWinGrid;
    11   
    12   namespace NorthwindTest
    13   {
    14       public partial class Form1 : Form
    15       {
    16           public Form1()
    17           {
    18               InitializeComponent();
    19           }
    20   
    21           private void Form1_Load(object sender, EventArgs e)
    22           {
    23               BusinessObjects.OrdersCollection ordersColl = new BusinessObjects.OrdersCollection();
    24               BusinessObjects.Orders orders = ordersColl.AddNew();
    25   
    26               /*
    27                */
    28   
    29               orders.OrderDetailsCollectionByOrderID.AllowNew = true;
    30               orders.OrderDetailsCollectionByOrderID.EnableHierarchicalBinding = false;
    31   
    32               this.bindingSource1.DataSource = orders.OrderDetailsCollectionByOrderID;
    33               
    34               this.ultraGrid1.DataSource = this.bindingSource1;
    35               
    36           }
    37   
    38           private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    39           {
    42               this.ultraGrid1.DisplayLayout.Override.AllowAddNew =
    43                   AllowAddNew.TemplateOnBottom;
    44   
    47               this.ultraGrid1.DisplayLayout.Override.RowSelectors =
    48                   DefaultableBoolean.True;
    49           }
    50       }
    51   }
    

    Occur the same behavior on UltraGrid.

    Thanks


    Welliton Toledo
  •  12-04-2007, 6:38 AM 6980 in reply to 6960

    Re: Entityspaces and infragistics wingrid

    This works fine for an MS DataGridView, and my Infragistics Trial has long since expired.

    Code:
    OrdersCollection ords = new OrdersCollection();
    Orders ord = ords.AddNew();
    
    bindingSource1.DataSource = ord.OrderDetailsCollectionByOrderID;
    dataGridView1.DataSource = bindingSource1;

    You might try something like this:

    Code:
    OrdersCollection ords = new OrdersCollection();
    Orders ord = ords.AddNew();
    
    OrderDetailsCollection od = ord.OrderDetailsCollectionByOrderID;
    od.CreateColumnsForBinding();
    
    bindingSource1.DataSource = od;
    dataGridView1.DataSource = bindingSource1;

    David Neal Parsons
    www.entityspaces.net
Page 2 of 2 (19 items)   < Previous 1 2
View as RSS news feed in XML