Resources for IT Professionals > Dynamics Forums > CRM Online > how to hide or show a column in axgridview?
Ask a questionAsk a question
 

Answerhow to hide or show a column in axgridview?

  • Thursday, October 22, 2009 10:16 AMfpsanti Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hello,
    sorry for the wrong (maybe) forum section but i could not find a more appropriate one.
    I am building an axgridview retrieving data from an AX dataset.
    I would like to add a control (e.g.: checkbox, button, toolbar menu, whatever) to let the client user to hide or show one or more columns.
    Here is the code of the axgridview.

    <dynamics:AxGridView ID="AxGridView1" runat="server" DataMember="View2" 
        DataSourceID="AxDataSource1" 
        onselectedindexchanged="AxGridView1_SelectedIndexChanged">
        <Columns>
            <dynamics:AxBoundField DataField="ItemId" DataSet="DataSet1" 
                DataSetView="View2" SortExpression="ItemId">
            </dynamics:AxBoundField>
            <dynamics:AxBoundField DataField="ItemName" DataSet="DataSet1" 
                DataSetView="View2" SortExpression="ItemName">
            </dynamics:AxBoundField>
            <dynamics:AxBoundField DataField="InventSizeId" DataSet="DataSet1" 
                DataSetView="View2" SortExpression="InventSizeId">
            </dynamics:AxBoundField>
            <dynamics:AxBoundField DataField="InventColorId" DataSet="DataSet1" 
                DataSetView="View2" SortExpression="InventColorId">
            </dynamics:AxBoundField>
            <dynamics:AxBoundField DataField="SumOfPhysicalInvent" DataSet="DataSet1" 
                DataSetView="View2" SortExpression="SumOfPhysicalInvent">
            </dynamics:AxBoundField>
        </Columns>
    </dynamics:AxGridView>
    
    I was thinking about setting the property of the field visible="false" but I do not know how to realize it. Let's try to hide or show InventSizeId for instance.
    Thank you very much in advance.

Answers

All Replies