Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1945
Inheriting XamDataGrid
posted

Hi

I want to create a new control based on XamDataGrid. My xaml:

<igDP:XamDataGrid x:Class="CustomControls.InfraDataGrid"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:igDP="http://infragistics.com/DataPresenter"
             x:Name="IDG">

</igDP:XamDataGrid>

When i set the DataSource:

<my:InfraDataGrid DataSource="{Binding Source={StaticResource BookData},XPath=Book}"/>

of this new control i get an error:

"Can't set the DataSource on a DataPresenter that has items added explicitly through the DataItems collection."

What am i doing wrong?