WPF C#에서 dataGrind를 만들고 동일한 열에 다른 유형의 셀을 사용하여 사용자 입력을 가져 오려고합니다. 해야는 다음과 같습니다DataGrid의 동일한 열에 다른 유형의 셀을 만드는 방법 - WPF C#
내 데이터 그리드 :
그래서 나는 텍스트 상자 셀에 이름과 나이 세포를 포맷하는 방법. 성별 및 국가 세포와 콤보 박스 세포?WPF C#에서 dataGrind를 만들고 동일한 열에 다른 유형의 셀을 사용하여 사용자 입력을 가져 오려고합니다. 해야는 다음과 같습니다DataGrid의 동일한 열에 다른 유형의 셀을 만드는 방법 - WPF C#
내 데이터 그리드 :
그래서 나는 텍스트 상자 셀에 이름과 나이 세포를 포맷하는 방법. 성별 및 국가 세포와 콤보 박스 세포?향후 더 많은 필드가 필요하고 일부 기능을 다시 사용하려면 WPF Property Grid을 살펴보십시오. 당신의 행이 레이아웃에서 해결하고 당신이 그 (것)들을 자주 변경하는 기대하지 않는 경우
, 당신은 표준 그리드 사용하여 다른 방법을 고려할 수 있습니다 : 당신이 다음 MVVM-패턴을 사용하는 경우
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock>Name</TextBlock>
<TextBlock Grid.Row="1">Age</TextBlock>
<TextBlock Grid.Row="2">Gender</TextBlock>
<TextBlock Grid.Row="3">State</TextBlock>
<TextBox Grid.Column="1"></TextBox>
<TextBox Grid.Row="1" Grid.Column="1"></TextBox>
<ComboBox Grid.Row="2" Grid.Column="1"></ComboBox>
<ComboBox Grid.Row="3" Grid.Column="1"></ComboBox>
</Grid>
을 (나는 그렇게 생각한다.) 셀을위한 ViewModel을 만들어서 ItemSource로 바인딩하자. ViewModel에서 필요한 요소를 설정할 수 있습니다. TextBox와 ComboBox 간에는 변경이 가능해야합니다.
이 가능한 여기에 해답 찾기 :
WPF DataGrid with different UserControl in each Cell을;
WPF DataGrid different edit controls within a single column
http://tech.pro/tutorial/807/wpf-tutorial-how-to-use-a-datatemplateselector
P.S. 그것의 대답을 위해 충분하지 않지만, 질문을 논평하기에 충분하지 않습니다.