Hi,
I have a table of data and I am using XamGrid to display them. I need the first column to be of variable width. But the succeeding columns to have a fixed width , which cannot be resized. I am using FieldlayoutSettings property in my xaml.
How can I achieve it?
Thanks,
Priya
Hello,
This can be done using the FieldSettings property of of the Field object. If you want to do it in xaml, you will have to create a FieldLayout and define your fields as I have done below.
<igDP:XamDataPresenter.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Label="Name">
<igDP:Field.Settings>
<igDP:FieldSettings AllowResize="False" CellWidth="100" LabelWidth="100"/>
</igDP:Field.Settings>
</igDP:Field>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataPresenter.FieldLayouts>
If you do not want the field to be resizable, you can set the AllowResize property to false. Then set the CellWidth and LabelWidth Properties and that will make the column one size and the user will not be allowed to resize it. For the column that you want to be able to resize, you can not set the AllowResize property (it is true by default) and then just give it a CellWidth and a LabelWidth. Then at runtime, the user will be able to resize the column.
I hope this is what you want.