Ejemplo n.º 1
0
 public virtual void SetUp(object uiControl)
 {
     grid            = ((GridControl)uiControl);
     grid.DataSource = null;
     unboundSource   = new UnboundSource();
     string[] names = Row.GetColumns();
     Type[]   types = Row.GetColumnTypes();
     unboundSource.Properties.AddRange(names.Select(
                                           (name, index) => new UnboundSourceProperty(name, types[index])
     {
         UserTag = index
     }));
     ((ColumnView)grid.MainView).Columns.Clear();
 }
        public void CreateDS()
        {
            UnboundSource         unboundDS = new UnboundSource();
            UnboundSourceProperty unboundSourceProperty1 = new UnboundSourceProperty()
            {
                DisplayName = "ID", Name = "Int", PropertyType = typeof(int)
            };
            UnboundSourceProperty unboundSourceProperty2 = new UnboundSourceProperty()
            {
                DisplayName = "Day of Week", Name = "String", PropertyType = typeof(string)
            };

            unboundDS.Properties.AddRange(new DevExpress.Data.UnboundSourceProperty[] {
                unboundSourceProperty1,
                unboundSourceProperty2
            });
            unboundDS.ValueNeeded += unboundDS_ValueNeeded;
            unboundDS.ValuePushed += unboundDS_ValuePushed;
            unboundDS.SetRowCount(100000);
            gridControl1.DataSource = unboundDS;
        }