XAML Part:
<ListBox x:Name="tgData"
Grid.Row="1"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Path=TableOne}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<ListBox
Style="{DynamicResource HorizontalList}"
ItemsSource="{Binding Path=Row.ItemArray}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Width="100" Text="{Binding}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Grid.Row="1"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Path=TableOne}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<ListBox
Style="{DynamicResource HorizontalList}"
ItemsSource="{Binding Path=Row.ItemArray}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Width="100" Text="{Binding}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
XAML Style for Horizontal List for columns:
<Style x:Key="HorizontalList" TargetType="{x:Type ListBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<StackPanel Orientation="Horizontal" Panel.IsItemsHost= "True"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<StackPanel Orientation="Horizontal" Panel.IsItemsHost= "True"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Code Behind (VB.Net):
Dim sConnectionString As String = "Data Source=Kelner;Database=Northwind;Integrated Security=SSPI;"
Dim sQueryString As String = "SELECT * FROM dbo.Customers"
Dim dsCustomer As New DataSet("CustomerData")
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection(sConnectionString)
Dim adapter As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(sQueryString, conn)
Dim customers As DataSet = New DataSet
adapter.Fill(dsCustomer, "TableOne")
tgData.DataContext = dsCustomer
Dim sQueryString As String = "SELECT * FROM dbo.Customers"
Dim dsCustomer As New DataSet("CustomerData")
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection(sConnectionString)
Dim adapter As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(sQueryString, conn)
Dim customers As DataSet = New DataSet
adapter.Fill(dsCustomer, "TableOne")
tgData.DataContext = dsCustomer
Enjoy!
J.
1 comment:
We have a List of Girls who are in financial problems.Call Girls whatsapp number in Agra They need your help. They are ready to sleep with you in some small amounts.Call Girls whatsapp number in Agra Call us for their contact no and help them.Call Girls whatsapp number in Ahmedabad To book an escort just drop a call to the given number and ask them what kind of service you want!.Call Girls whatsapp number in Haridwar You will also WhatsApp us for the availability of our Escorts contact number in Aerocity . If you’re in the end determined and ready to enjoy the amusing of being at duration the corporate of one of our beautiful girls.Call Girls whatsapp number in Delhi Check our other Services...
Post a Comment