Frage

Ich möchte die Spaltenbreite von XamDataGrid in XAML festlegen. Es gibt keine Width-Eigenschaft verfügbar wie

<ip:Field Label="Name" ........... Width="60"/>

Hier ist mein Beispielcode.

    <ip:XamDataGrid Name="PatientsList" DataSource="{Binding PatientsList}" SelectedItemsChanged="PatientsListSelectedItemsChanged"
                    XamDataGridBehaviours:XamDataGridBehavior.IsSynchronizedWithCurrentItem="True" GroupByAreaLocation="None">
        <ip:XamDataGrid.FieldLayoutSettings>
            <ip:FieldLayoutSettings AutoGenerateFields="False" SelectionTypeRecord="Extended" MaxSelectedRecords="1"/>
        </ip:XamDataGrid.FieldLayoutSettings>
        <ip:XamDataGrid.FieldSettings>
            <ip:FieldSettings AllowEdit="False" CellClickAction="SelectRecord"/>
        </ip:XamDataGrid.FieldSettings>
        <ip:XamDataGrid.FieldLayouts>
            <ip:FieldLayout>
                <ip:FieldLayout.Fields>
                    <ip:Field Label="{Binding Source={x:Static properties:Resources.StudyManager_colSex}}" Name="Sex"/>
                    <ip:Field Label="{Binding Source={x:Static properties:Resources.StudyManager_colPatientId}}" Name="PatientId"/>
                    <ip:Field Label="{Binding Source={x:Static properties:Resources.StudyManager_colLastName}}" Name="LastName" />
                    <ip:Field Label="{Binding Source={x:Static properties:Resources.StudyManager_colFirstName}}" Name="FirstName" />
                    <ip:Field Label="{Binding Source={x:Static properties:Resources.StudyManager_colPatientId}}" Name="FullName" />
                    <ip:Field Label="{Binding Source={x:Static properties:Resources.StudyManager_colDOB}}" Name="DateOfBirth" />
                </ip:FieldLayout.Fields>
            </ip:FieldLayout>
        </ip:XamDataGrid.FieldLayouts>
    </ip:XamDataGrid>
War es hilfreich?

Lösung

Eine Width Eigenschaft wurde in der Version 9.2 auf Felder hinzugefügt. Aber es waren schon immer CellWidth, CellMinWidth und CellMaxWidth Eigenschaften auf der FieldSettings und jedes Feld eine eigene FieldSettings hat.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top