Question

I have declared a DataGrid in UserControl.

Now I have included the UserControl in my main xaml file. I am trying to set the ItemsSource property of DataGrid from main.xaml; but I am getting an error "The property ItemsSource doesnot exist in the namespace".

I am able to set the other properties like Background,Foreground, etc.

My UserControl has this :

<wpfkit:DataGrid Name="DataGrid1"  
                     AutoGenerateColumns="True"
                     Width="Auto">
</wpfkit:DataGrid>

In main.xaml :

<usercontrol:MultiStepProcessGrid ItemsSource="{Binding GridData}" ></usercontrol:MultiStepProcessGrid>

The above line is giving an error stating that ItemsSource doesnot exist in namespace.
So I wanted to know whether its possible to set the ItemsSource from main.xaml or not!!

Please help me regarding this !!!

Was it helpful?

Solution

Try this

<wpfkit:DataGrid Name="DataGrid1"  
                     ItemSource="{Binding}"
                     AutoGenerateColumns="True" 
                     Width="Auto"> 
</wpfkit:DataGrid> 

and

<usercontrol:MultiStepProcessGrid DataContext="{Binding GridData}" ></usercontrol:MultiStepProcessGrid> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top