在inffragistics XamDataGrid中添加一个组合框列



如何将WPF组合框列添加到inffragistics XamDataGrid?

试试这个例子

                                        <dataPresenter:XamDataGrid x:Name="StudentDataGrid" DataSource="{Binding StudentList}">
                                        <dataPresenter:XamDataGrid.FieldLayoutSettings>
                                            <dataPresenter:FieldLayoutSettings AutoGenerateFields="False" AutoFitMode="Always" AddNewRecordLocation="OnTopFixed" AllowAddNew="True" AllowDelete="True"/>
                                        </dataPresenter:XamDataGrid.FieldLayoutSettings>
                                        <dataPresenter:XamDataGrid.FieldLayouts>
                                            <dataPresenter:FieldLayout>
                                                <dataPresenter:Field Name="Name" Label="Student Name"/>
                                                <dataPresenter:Field Width="Auto" Name="Department" Label="Dept">
                                                    <dataPresenter:Field.Settings>
                                                        <dataPresenter:FieldSettings>
                                                            <dataPresenter:FieldSettings.EditorStyle>
                                                                <Style TargetType="{x:Type igEditors:XamComboEditor}">
                                                                    <Setter Property="ItemsSource" Value="{Binding DataPresenter.DataContext.DepartmentList}" />
                                                                    <Setter Property="IsEditable" Value="True" />
                                                                    <Setter Property="Text" Value="-Select-" />
                                                                    <Setter Property="DisplayMemberPath" Value="DeptName" />
                                                                    <Setter Property="ValuePath" Value="DeptName" />
                                                                </Style>
                                                            </dataPresenter:FieldSettings.EditorStyle>
                                                        </dataPresenter:FieldSettings>
                                                    </dataPresenter:Field.Settings>
                                                </dataPresenter:Field>
                                                <dataPresenter:Field Name="Count" Label="Count"/>
                                            </dataPresenter:FieldLayout>
                                        </dataPresenter:XamDataGrid.FieldLayouts>
                                    </dataPresenter:XamDataGrid>

您可以使用XamComboEditor编辑XamDataGrid中的字段:http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=xamComboEditor_Using_xamComboEditor_to_Edit_a_Field_in_xamDataGrid.html

艾伦

相关内容

  • 没有找到相关文章

最新更新