Exemple #1
0
        private void BRecord_Click(object sender, EventArgs e)
        {
            MyData.FillMyData(MyListData, 10);

            teeGrid1.Data = new VirtualListData <Person>(MyListData);

            teeGrid1.Columns["BirthDate"].DataFormat.DateTime = "dd-MM-yyyy";

            SetExpander("Name", teeGrid1.Rows);

            teeGrid1.Footer.Clear();

            ColumnTotals tmp = Totals(teeGrid1.Footer);

            TotalsHeader.CreateTotals(teeGrid1.Footer, tmp);

            AddSampleFooter();

            SampleHeader?.Dispose();

            SampleHeader = NewTitle(teeGrid1.Headers, "Header Sample" + Environment.NewLine + "Text");

            SampleHeader.Index = 0;

            SetupCellEditors();

            teeGrid1.CellEditing += GridCellEditing;
        }
Exemple #2
0
        private void DetailNewGroup(object sender, Steema.TeeGrid.RowGroup.NewDetailEventArgs e)
        {
            ColumnTotals tmpTot = new ColumnTotals(e.NewGroup.Footer);

            tmpTot.Calculation.Add(e.NewGroup.Columns[0], ColumnCalculation.Count);
            tmpTot.Calculation.Add("EmployeeID", ColumnCalculation.Sum);

            TotalsHeader.CreateTotals(e.NewGroup.Footer, tmpTot);
        }
Exemple #3
0
        public Form1()
        {
            InitializeComponent();

            this.BackColor = Color.White;
            Steema.TeeGrid.Themes.GridThemes.BlueFlat.ApplyTo(tTeeGrid1.Grid);

            //Customize Footers
            TextBand tmpFooter = tTeeGrid1.Footer.AddText("Footer 1");

            tmpFooter.Format.Font.Style = Steema.TeeGrid.Format.FontStyle.Bold;
            tmpFooter.Format.Font.Size  = 14;
            tmpFooter.Format.Font.Color = ColorTranslator.FromHtml("#3C95D5");

            tTeeGrid1.Footer.AddText("Footer 2" + Environment.NewLine + "SubFooter 2").Format.Font.Size = 14;
            tTeeGrid1.Footer[1].Format.Font.Color = ColorTranslator.FromHtml("#014677");

            tTeeGrid1.Footer.AddText("Footer 3").TextRender.TextAlign.Horizontal = HorizontalAlign.Center;
            tTeeGrid1.Footer[2].Format.Font.Size = 25;

            //Customize Headers

            Steema.TeeGrid.Format.Brush brush = tTeeGrid1.Headers.AddText("Header 1").Format.Brush;
            brush.Show();
            brush.Gradient.Show();
            tTeeGrid1.Headers[1].Format.Font.Size  = 14;
            tTeeGrid1.Headers[1].Format.Font.Style = Steema.TeeGrid.Format.FontStyle.Bold;

            tTeeGrid1.Headers.AddText("Header 2").TextRender.TextAlign.Horizontal = HorizontalAlign.Center;
            GridBand tmpBand = tTeeGrid1.Headers[2];

            tmpBand.Format.Font.Color = ColorTranslator.FromHtml("#3C95D5");
            tmpBand.Format.Font.Size  = 20;
            tmpBand.Format.Font.Style = Steema.TeeGrid.Format.FontStyle.Bold;
            //		tmpBand.Horizontal = HorizontalAlign.Center;

            tTeeGrid1.Headers.AddText("Header 3").TextRender.TextAlign.Horizontal = HorizontalAlign.Right;
            tTeeGrid1.Headers[3].Format.Font.Color = ColorTranslator.FromHtml("#014677");
            tTeeGrid1.Headers[3].Format.Font.Size  = 20;
            tTeeGrid1.Headers[3].Format.Stroke.Show();
            tTeeGrid1.Headers[3].Format.Stroke.Size  = 2;
            tTeeGrid1.Headers[3].Format.Stroke.Color = ColorTranslator.FromHtml("#6BABD0");

            //grid data
            List <THouse> houses = new List <THouse>();
            Random        rnd    = new Random();

            for (int t = 0; t < 100; t++)
            {
                houses.Add(new THouse()
                {
                    Address = t.ToString() + rnd.Next(1, 100).ToString() + " St", Floors = rnd.Next(1, 10)
                });
            }

            tTeeGrid1.Data = new VirtualListData <THouse>(houses);

            tmpBand.Index = 0;

            tmpFooter.TextRender.TextAlign.Horizontal = HorizontalAlign.Center;

            //standard footer
            tTeeGrid1.Footer.AddText("My Footer");

            //add column total title as footer
            TotalsHeader theader = new TotalsHeader(tTeeGrid1.Footer);

            //add column total footer
            ColumnCalculation columnCalc = ColumnCalculation.Sum;

            ColumnTotals cTotals = new ColumnTotals(tTeeGrid1.Footer);             //if header required use tTeeGrid1.Headers as arg

            cTotals.Calculation.Add(tTeeGrid1.Columns[1], columnCalc);
        }