Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
setting Column width of XamDataGrid in XAML
posted

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: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>

  • 2677
    posted

    Hello,

    Im not sure why you cant see a width property.  There should be one in there in the Field object.

     <igDP:Field Name="Column_1" Label="Column_1" Width="150"/>

    If you still have this issue, pleas let me know.  If I have misunderstood your question, please let me know.