2
我想在XAML中設置XamDataGrid的列寬。有沒有寬度屬性可用像設置XAML中XamDataGrid的列寬
<ip:Field Label="Name" ........... Width="60"/>
這是我的示例代碼。
<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>
@Mike:你有沒有在XAML中試過它們?至少我不能在v7.2中訪問它們。 – Saghar 2010-11-05 14:30:45
您可以像這樣定義一個字段: < ip:FieldSettings CellMaxWidth =「50」/> ' –
2010-11-05 14:47:17
讓我試試看。 – Saghar 2010-11-05 15:00:25