Ejemplo n.º 1
0
        public void InitializeTable()
        {
            this.table = new DataTable("Konsole");
            DataColumn c = null;
            c = new DataColumn();
            c.DataType = System.Type.GetType("System.String");
            c.ColumnName = "cout";
            c.ReadOnly = true;
            c.Unique = false;
            table.Columns.Add(c);

            c = new DataColumn();
            c.DataType = System.Type.GetType("System.String");
            c.ColumnName = "otype";
            c.ReadOnly = true;
            c.Unique = false;
            table.Columns.Add(c);

            c = new DataColumn();
            c.DataType = System.Type.GetType("System.String");
            c.ColumnName = "dstamp";
            c.ReadOnly = true;
            c.Unique = false;
            table.Columns.Add(c);

            // Insert code to create and populate columns.
            this.view = new DataView(table);

            this.mainForm.Invoke(new InvokeDelegate(this.SetDataToDataGrid));

            DataGridTableStyle ts = new DataGridTableStyle();
            ts.MappingName = "Konsole";

            DataGridTextBoxColumn cout = new KonsoleColumnStyle( this.table );
            cout.MappingName = "cout";
            cout.HeaderText = "cout";
            ts.GridColumnStyles.Add( cout );

            DataGridTextBoxColumn dstamp = new KonsoleColumnStyle( this.table );
            dstamp.MappingName = "dstamp";
            dstamp.HeaderText = "dstamp";
            ts.GridColumnStyles.Add( dstamp);

            /*	KonsoleColumnStyle kstyle = new KonsoleColumnStyle( this.table );
            kstyle.MappingName = "otype";
            kstyle.HeaderText = "otype";
            kstyle.Width = 50;
            ts.GridColumnStyles.Add( kstyle ); */

            this.dataGrid1.TableStyles.Clear();
            this.dataGrid1.TableStyles.Add(ts);
            this.dataGrid1.TableStyles["Konsole"].GridColumnStyles["cout"].Width = 750;

            this.dataGrid1.TableStyles["Konsole"].GridColumnStyles["dstamp"].Width = 100;
        }
Ejemplo n.º 2
0
        public void InitializeTable()
        {
            this.table = new DataTable("Konsole");
            DataColumn c = null;

            c            = new DataColumn();
            c.DataType   = System.Type.GetType("System.String");
            c.ColumnName = "cout";
            c.ReadOnly   = true;
            c.Unique     = false;
            table.Columns.Add(c);

            c            = new DataColumn();
            c.DataType   = System.Type.GetType("System.String");
            c.ColumnName = "otype";
            c.ReadOnly   = true;
            c.Unique     = false;
            table.Columns.Add(c);

            c            = new DataColumn();
            c.DataType   = System.Type.GetType("System.String");
            c.ColumnName = "dstamp";
            c.ReadOnly   = true;
            c.Unique     = false;
            table.Columns.Add(c);



            // Insert code to create and populate columns.
            this.view = new DataView(table);

            this.mainForm.Invoke(new InvokeDelegate(this.SetDataToDataGrid));

            DataGridTableStyle ts = new DataGridTableStyle();

            ts.MappingName = "Konsole";



            DataGridTextBoxColumn cout = new KonsoleColumnStyle(this.table);

            cout.MappingName = "cout";
            cout.HeaderText  = "cout";
            ts.GridColumnStyles.Add(cout);


            DataGridTextBoxColumn dstamp = new KonsoleColumnStyle(this.table);

            dstamp.MappingName = "dstamp";
            dstamp.HeaderText  = "dstamp";
            ts.GridColumnStyles.Add(dstamp);

            /*	KonsoleColumnStyle kstyle = new KonsoleColumnStyle( this.table );
             *      kstyle.MappingName = "otype";
             *      kstyle.HeaderText = "otype";
             *      kstyle.Width = 50;
             *      ts.GridColumnStyles.Add( kstyle ); */

            this.dataGrid1.TableStyles.Clear();
            this.dataGrid1.TableStyles.Add(ts);
            this.dataGrid1.TableStyles["Konsole"].GridColumnStyles["cout"].Width = 750;

            this.dataGrid1.TableStyles["Konsole"].GridColumnStyles["dstamp"].Width = 100;
        }