开发者

setting Column width of XamDataGrid in XAML

I want to set the Column width of XamDataGrid in XAML. There is no Width Property available like

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

Here is my sample code.

    <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:FieldLayo开发者_开发问答ut>
                <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>


A Width property was added to Fields in version 9.2. But there have always been CellWidth, CellMinWidth, and CellMaxWidth properties on the FieldSettings and each field has its own FieldSettings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜