당신이 쉽게 할 수 있다고 생각지 않는다. 개인적으로 IValueConverter 인터페이스를 사용하여 DataSet을 내부에서 열을 관리 할 수있는 객체로 변환 할 것이다.
public sealed class DataSetConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if((DataSet)value != null)
{
// Put logic in here to loop through the columns and create an object to bind to the ListView control.
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
}
XAML 코드
<conv:DataSetConverter x:key="datasetConverter"/>
<ListBox x:Name="listbox1" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding datasetObject, Converter={StaticResource datasetConverter}}" >
때문에 데이터 집합은 강력한 형식되지 않는 이유는 무엇입니까? 그래서 그것은 역동적입니까? –
이 맞습니다. 강력하게 타입이 지정되지 않은 –