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
320
Hide a column
posted

Hi,

 I have just started to use the xamDatagrid and would like to hide a field which I want to be able to retrieve as an idenfier of the record displayed. I have defined a field and set the visibility property to False as well as disable the Autocreation of columns. The end result is that I can still see the column in the grid but the content is hidden. How do I completely hide the column that I only want to use to as a data reference ?

 Niclas

Parents
No Data
Reply
  • 2125
    posted

    Hi nlindblo,

    You can hide a xamDataGrid field(column)  through using both xaml and code.

    1. Through xaml:

    <igDP:XamDataGrid.FieldLayouts>
       <igDP:FieldLayout>
           <igDP:FieldLayout.Fields>
               <igDP:Field Name="name" Label="Name" Visibility="Collapsed"/>
               <igDP:Field Name="department" Label="Department"/>
               <igDP:Field Name="salary" Label="Salary"/>
               <igDP:Field Name="email" Label="Email"/>
           </igDP:FieldLayout.Fields>
       </igDP:FieldLayout>
    </igDP:XamDataGrid.FieldLayouts>          


    2. Through code:

    xamDataGrid1.FieldLayouts[0].Fields["salary"].Visibility = Visibility.Collapsed;


    The attached HideXamDataGridColumn sample application contains a solution based on both the ways.


    Best Regards,
    Yanko

    HideXamDataGridColumn.zip
Children