1

我正在尝试实现问题,将 XamDataGrid 中的新行的一列设置为不可编辑,

<igDP:XamDataGrid.FieldLayouts>
    <igDP:FieldLayout>
        <igDP:Field Name="LOAD_ID" Visibility="Visible">
            <igDP:Field.Settings>
                <igDP:FieldSettings AllowGroupBy="True"
                                    AllowEdit="False"
                                    AllowRecordFiltering="True"
                                    FilterOperatorDefaultValue="Contains" />
            </igDP:Field.Settings>
        </igDP:Field>
        <igDP:Field Name="DESCRIPTION" Visibility="Visible">
            <igDP:Field.Settings>
                <igDP:FieldSettings AllowGroupBy="True"
                                    AllowEdit="True"
                                    AllowRecordFiltering="True"
                                    FilterOperatorDefaultValue="Contains" />
            </igDP:Field.Settings>
        </igDP:Field>
    </igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>

在 Load_id 的情况下,我已经将允许编辑设置为 false,但不知何故,这只会影响网格中已经加载的记录,而不是要添加的记录。

<igDP:FieldLayoutSettings
                AllowAddNew="True"
                AddNewRecordLocation="OnBottomFixed" 
                AutoFitMode="Always"
                AutoGenerateFields="False" HighlightAlternateRecords="True" HeaderPrefixAreaDisplayMode="FieldChooserButton" 
                />

它可能是 XamDataGrid 控件中的一个简单属性,但不知何故被我错过了。任何帮助,将不胜感激。

4

1 回答 1

1

这对我有用

  <ig:UnboundField Label="Filter"  BindingPath="AggregateFilter" BindingMode="TwoWay" >
                            <ig:UnboundField.Settings>
                                <ig:FieldSettings EditorType="{x:Type Editors:XamTextEditor}">
                                <ig:FieldSettings.EditorStyle>
                                    <Style TargetType="{x:Type Editors:XamTextEditor}">
                                            <Setter Property="IsReadOnly" Value="{Binding Path=DataContext.isCusipMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ig:XamDataGrid}}}"/>
                                    </Style>
                                </ig:FieldSettings.EditorStyle>
                            </ig:FieldSettings>
                            </ig:UnboundField.Settings>
                        </ig:UnboundField>
于 2012-08-29T09:49:49.847 回答