Exemplo n.º 1
0
        private void comboBoxClassColumn_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            valuesWithClass = DataTableService.GetColumnsFromTableAsValuesWithClassList(table, comboBoxClassColumn.SelectedIndex);
            int j = 0;

            for (int i = 1; i < columnBinding.Count; i++)
            {
                if (i != comboBoxClassColumn.SelectedIndex)
                {
                    gridValues.ColumnDefinitions.Add(new ColumnDefinition()
                    {
                        Width = GridLength.Auto
                    });

                    Label tempLabel = new Label();
                    tempLabel.Name    = "labelValue" + i;
                    tempLabel.Content = columnBinding[i];
                    tempLabel.HorizontalContentAlignment = HorizontalAlignment.Center;

                    TextBox tempTextBox = new TextBox();
                    tempTextBox.Name   = "textBoxValue" + i;
                    tempTextBox.Height = 30;
                    tempTextBox.HorizontalContentAlignment = HorizontalAlignment.Center;

                    gridValues.Children.Add(tempLabel);
                    gridValues.Children.Add(tempTextBox);

                    Grid.SetRow(tempLabel, j);
                    Grid.SetColumn(tempLabel, i - (j / 2 * 20));

                    Grid.SetRow(tempTextBox, j + 1);
                    Grid.SetColumn(tempTextBox, i - (j / 2 * 20));
                }
                if (i % 20 == 0 && i != 0)
                {
                    j += 2;
                    gridValues.RowDefinitions.Add(new RowDefinition()
                    {
                        Height = GridLength.Auto
                    });
                    gridValues.RowDefinitions.Add(new RowDefinition()
                    {
                        Height = GridLength.Auto
                    });
                }
            }
            DataContext = this;
        }
Exemplo n.º 2
0
 private void comboBoxClassColumn_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     valuesWithClass = DataTableService.GetColumnsFromTableAsValuesWithClassList(mainTable, comboBoxClassColumn.SelectedIndex);
 }