Я хочу добавить некоторые элементы управления в DataGrid
.
У меня есть XML-код:
<DataGrid Name="dgCreateOperationsData" HorizontalScrollBarVisibility="Hidden" HorizontalAlignment="Left" Height="214" Margin="2,170,0,0" VerticalAlignment="Top" Width="775" FontWeight="Bold" HeadersVisibility="None" SelectionMode="Single" Background="White" CanUserAddRows="False" CanUserDeleteRows="False" ColumnWidth="100"/>
и следующий код:
OperationEntry opEntry = new OperationEntry();
opEntry.OperationName = new ComboBox() { Width = 50, ItemsSource = _operationList};
opEntry.Time = new TextBox() { Width = 50, Text = "" };
opEntry.Flow = new TextBox() { Width = 50, Text = "" };
opEntry.SysSpeed = new TextBox() { Width = 50, Text = "" };
opEntry.Pressure = new TextBox() { Width = 50, Text = "" };
opEntry.Torque = new TextBox() { Width = 50, Text = "" };
opEntry.Power = new TextBox() { Width = 50, Text = "" };
opEntry.Current = new TextBox() { Width = 50, Text = "" };
_operationEntryList.Add(opEntry);
dgCreateOperationsData.ItemsSource = _operationEntryList;
Проблема в том, что элементы управления отображаются, но вид элемента управления виден, пока я дважды не щелкну по нему (см. Изображение)

Почему это происходит?И как убрать эти ярлыки ??