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; }
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); }
private void computeKappaVariance() { // References: Statistical Methods for Rates and Proportions int[,] m = matrix; double k = Kappa; double[] colMarginal = ColumnTotals.Divide((double)samples); double[] rowMarginal = RowTotals.Divide((double)samples); double directionSum = 0; for (int i = 0; i < classes; i++) { directionSum += rowMarginal[i] * colMarginal[i]; } double pe = directionSum; // Compute A (eq. 18.16) double A = 0; for (int i = 0; i < classes; i++) { double u = 1 - (rowMarginal[i] + colMarginal[i]) * (1 - k); A += (m[i, i] / (double)samples) * u * u; } // Compute B (eq. 18.17) double sum = 0; for (int i = 0; i < rowMarginal.Length; i++) { for (int j = 0; j < colMarginal.Length; j++) { if (i != j) { sum += (m[i, j] / (double)samples) * (colMarginal[i] + rowMarginal[j]); } } } double B = (1 - k) * (1 - k) * sum; // Compute C double v = k - pe * (1 - k); double C = v * v; // Compute variance using A, B and C kappaVariance = (A + B - C) / ((1 - pe) * (1 - pe) * samples); // Compute standard error directly kappaStdError = Math.Sqrt(A + B - C) / ((1 - pe) * Math.Sqrt(samples)); }
private ColumnTotals Totals(IObservableCollection collection) { ColumnTotals result = new ColumnTotals(collection); result.Calculation.Add("Name", ColumnCalculation.Count); result.Calculation.Add("Children", ColumnCalculation.Sum); result.Calculation.Add("Height", ColumnCalculation.Average); result.Calculation.Add(result.Columns["Address"].Items["Number"], ColumnCalculation.Max); result.Calculation.Add(result.Columns["Car"].Items["kW"], ColumnCalculation.Min); result.Format.Font.Style = Steema.TeeGrid.Format.FontStyle.Bold | Steema.TeeGrid.Format.FontStyle.Italic; return(result); }
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); }