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
2915
Hide a column in XamDataGrid
posted

Hi,

    I have checked for this in the forum but I didn't really find what I was looking for.

    I have a XamDataGrid which is bound to a data table. I am NOT setting the AutoGenerateColumns to False. Additionally, I have these 2 unbound fields also below -

<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:UnboundField Name="Edit">
<igDP:UnboundField.Settings>
<igDP:FieldSettings AllowResize="False" AllowGroupBy="False" AllowRecordFiltering="False" AllowSummaries="False" LabelTextAlignment="Center"
 CellValuePresenterStyle="{StaticResource CellButtonStyle2}"/>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>

Now I want one column to be hidden by default (not the above unbound column), but the auto generated one. And when user clicks a button, I want to make the column visible. How can I hide a column without having to change the AutoGenerateColumns to False?