Exemplo n.º 1
0
        private void AddDataItem(Field field, IEnumerable <ObjectData> items)
        {
            foreach (Control ctrl in this.controls)
            {
                Field f = ctrl.Tag as Field;
                if (f != null && f != field)
                {
                    foreach (ObjectData d in items)
                    {
                        switch (f.FieldType)
                        {
                        case FieldType.Reference:
                            if (ReferenceProperty.Get(f).Reference == d.ObjectClass)
                            {
                                KryptonComboBox box = (KryptonComboBox)ctrl;
                                if (!box.Items.Contains(d))
                                {
                                    box.Items.Add(d);
                                }
                            }

                            break;

                        case FieldType.Table:
                            TableControl table = (TableControl)ctrl;
                            table.AddDataItem(d);
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private Control CreateTableControl(ObjectData obj, Field field)
        {
            TableControl grid = new TableControl(Data, obj, field);

            return(grid);
        }