Exemplo n.º 1
0
        DataGridTextColumn createColumn(string columnName, string property, string header)
        {
            DataGridTextColumn dgc = new DataGridTextColumn
            {
                Header = header
            };
            Binding b = new Binding(property)
            {
                Mode = BindingMode.OneWay,
            };

            dgc.Binding = b;

            DataGridUtil.SetName(dgc, columnName);

            return(dgc);
        }
Exemplo n.º 2
0
        DataGridTextColumn createColumnDiffInPercentage(string header, string property)
        {
            DataGridTextColumn dgc = new DataGridTextColumn
            {
                Header = header
            };
            Binding b = new Binding(property)
            {
                Mode = BindingMode.OneWay,
            };

            b.Converter   = new PercentageConverter(false);
            dgc.Binding   = b;
            dgc.CellStyle = new Style();
            dgc.CellStyle.Setters.Add(new Setter {
                Property = TextBlock.TextAlignmentProperty, Value = TextAlignment.Right
            });

            DataGridUtil.SetName(dgc, "Percentage");

            return(dgc);
        }
Exemplo n.º 3
0
        DataGridTextColumn createColumnPosition(string columnName, string property, bool inParantheses)
        {
            DataGridTextColumn dgc = new DataGridTextColumn
            {
                Header = "Pos"
            };
            Binding b = new Binding(property)
            {
                Mode = BindingMode.OneWay,
            };

            b.Converter   = new PositionConverter(inParantheses);
            dgc.Binding   = b;
            dgc.CellStyle = new Style();
            dgc.CellStyle.Setters.Add(new Setter {
                Property = TextBlock.TextAlignmentProperty, Value = TextAlignment.Right
            });

            DataGridUtil.SetName(dgc, columnName);

            return(dgc);
        }