Click here to Skip to main content
15,793,452 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi

I want to bind Listview WPF usercontrol inside usercontrol WPF.
How it's possible ?

VB.NET
Private Sub UserControl_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded

        Dim table As DataTable = GetTable()
        Dim cntrlMenuItem As New cntrlMenuItem
        cntrlMenuItem.lblCategory.Content = "New Arrivals"
		cntrlMenuItem.listBox1.ItemsSource = table.DefaultView . Tried this
        cntrlMenuItem.listBox1.DataContext = table.DefaultView 'Tried this
        'Me.DataContext = table.DefaultView ' tried this

        StackPanel1.Children.Add(cntrlMenuItem)
     
    End Sub
	
	but i failed listview is showing empty and label will showes right text.

Thanks in advance

What I have tried:

I tried but didn't got the solution please solve as soon as possible.
Posted
Comments
Sergey Alexandrovich Kryukov 2-May-16 9:48am    
What exactly do you mean to achieve?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900