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
340
Add value to collection of type DataItemsCollection exception w/ Specific Fields
posted

Hi,

We're currently encountering an issue where we get a "Add value to collection of type 'Infragistics.Windows.DataPresenter.DataPresenterBase+DataItemsCollection' threw an exception.'" exception whenever the application is launched.

Additionally, we get a "Can't add items to a DataPresenter that is bound to a DataSource". I don't think we're trying to add items, I only want to present the items from the collection in a certain way, my understanding is that Field Labels was the way to achieve this. This only occurs when we set AutoGenerateFields = False and specify a set of fields in the FieldLayout. I've attached a sample project showing this behavior.

<Grid>
    <igDP:XamDataGrid DataSource="{Binding AlgorithmVersions}"
                               ScrollingMode="DeferredWithScrollTips"
                               RecordFilterDropDownPopulating="Grid_OnRecordFilterDropDownPopulating">
    <igDP:XamDataGrid.FieldSettings>
    <igDP:FieldSettings AllowEdit="True"  
                              AllowResize="False"
                              AllowFixing="Near"
                              AllowRecordFiltering="True"
                              CellClickAction="SelectRecord" 
                              EditorStyleSelector="{StaticResource FieldStyleSelector}"/>
    </igDP:XamDataGrid.FieldSettings>
    <igDP:XamDataGrid.FieldLayoutSettings>
        <igDP:FieldLayoutSettings AllowAddNew="True"
                                           HeaderPrefixAreaDisplayMode="FieldChooserButton"
                                           AllowFieldMoving="WithinLogicalRow" 
                                           AddNewRecordLocation="OnTopFixed"  
                                           HighlightAlternateRecords="True" 
                                           AutoGenerateFields="False" 
                                           AllowClipboardOperations="All"/>
        </igDP:XamDataGrid.FieldLayoutSettings>
    <igDP:FieldLayout>
        <igDP:FieldLayout.Fields>
            <igDP:Field Name="PRIORITY" Label="Priority"/>
            <igDP:Field Name="RESPONSE_CRITERIA" Label="Response Criteria"/>
            <igDP:Field Name="CONSEQUENCE_CLASS_CL" Label="Consequence Classification"/>
            <igDP:Field Name="RESPONSE_CLASS_CL" Label="Response Classification"/>
            <igDP:Field Name="PRIORITY" Label="Response Schedule (Days)"/>
            <igDP:Field Name="PRESSURE_REDUCTION_CL" Label="Pressure Reduction"/>
       </igDP:FieldLayout.Fields>
    </igDP:FieldLayout>
    </igDP:XamDataGrid>
</Grid>
XamDataGrid_SpecifiedFields.zip