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
506
Theme problem
posted

Hi,

I've two datagrid in a panel (see code).

The first datagrid give me some problem if I set the Theme.
The second works good with the Theme.

The error that the system give me when i activate one record is this and after I can't enter in edit mode.

System.Windows.Data Error: 39 : BindingExpression path error: 'Host' property not found on 'object' ''String' (HashCode=-1182919484)'. BindingExpression:Path=Content.Host.DataContext; DataItem='ContentPresenter' (Name=''); target element is 'ContentPresenter' (Name=''); target property is 'DataContext' (type 'Object')

If I work with the standard theme there is no problems.

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.45*"/>
            <ColumnDefinition Width="0.1*"/>
            <ColumnDefinition Width="0.45*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0">
            <igDP:XamDataGrid Name="dgListaAlternative" >
                <igDP:XamDataGrid.FieldLayoutSettings>
                    <igDP:FieldLayoutSettings />
                </igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:XamDataGrid.FieldLayouts>
                    <igDP:FieldLayout Key="layout">
                        <igDP:FieldLayout.Fields>
                        </igDP:FieldLayout.Fields>
                    </igDP:FieldLayout>
                </igDP:XamDataGrid.FieldLayouts>
            </igDP:XamDataGrid>
        </Grid>
        <Grid Grid.Column="2">
            <igDP:XamDataGrid Name="dgListaGruppi">
                <igDP:XamDataGrid.FieldLayoutSettings>
                    <igDP:FieldLayoutSettings />
                </igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:XamDataGrid.FieldLayouts>
                    <igDP:FieldLayout Key="layout">
                        <igDP:FieldLayout.Fields>
                        </igDP:FieldLayout.Fields>
                    </igDP:FieldLayout>
                </igDP:XamDataGrid.FieldLayouts>
            </igDP:XamDataGrid>
        </Grid>
    </Grid>

Thanks for the help.

  • 975
    Suggested Answer
    Offline posted

    Hi,

    For reference, if your still interested, I just encounter the same problem. In my case the problem was that the field was bind to a property of type Object. I change my property type to a primitive type and it work just fine.

    Regards,

    Dominik

  • 69686
    posted

    Hello,

    The xaml code that you have provided contains two identical XamDataGrids and I doubt that one will cause problems and the other not. You are probably retemplating the CellValuePresenter or other element (like value editor) which is causing this, as the Binding expression error shows that a property cannot be found.

  • 506
    Offline posted

    Any ideas?