Sort DESC asp

2

I have a grid in my application. The code for a grid column is:

<Columns>
                        <asp:BoundColumn DataField="DATA_CADASTRO" SortExpression="DATA_CADASTRO"  HeaderText="Data Ativa&#231;&#227;o"
                            DataFormatString="{0:dd/MM/yyyy}">
                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundColumn>

I would like to set the filter for this column with DESC , since the default is already ASC .

How can I do this?

    
asked by anonymous 12.03.2015 / 20:35

1 answer

2

In the Datagrid, add AllowSorting="True" , and in the column add DESC:

<asp:BoundColumn DataField="DATA_CADASTRO" SortExpression="DATA_CADASTRO DESC" HeaderText="Data Ativa&#231;&#227;o" DataFormatString="{0:dd/MM/yyyy}">

    
12.03.2015 / 20:53