Q:

ASPxGridView sorting without Headers

I am using devexpress gridview i want sorting in devexpress there is no header in gridview 
Settings-ShowColumnHeaders="false" based upon the dropdown selected i need sorting. 
i want sorting in C#. 
switch (ddlSortField. SelectedItem. Value. Trim()) {
case "ViolationDate":
    ASPxGVTickets. SortBy(ASPxGVTickets. Columns["ViolationDate"], DevExpress. Data. ColumnSortOrder. Descending);
    break;
case "FName":
    ASPxGVTickets. SortBy(ASPxGVTickets. Columns["FName"], DevExpress. Data. ColumnSortOrder. Descending);
    break;
case "LName":
    ASPxGVTickets. SortBy(ASPxGVTickets. Columns["LName"], DevExpress. Data. ColumnSortOrder. Descending);
    break;
case "CourtName":
    ASPxGVTickets. SortBy(ASPxGVTickets. Columns["CourtName"], DevExpress. Data. ColumnSortOrder. Descending);
    break;
}

A:

I see that the column. FieldName matches the SelectedItem. Text. 
If so, modify your code as follows:
ASPxGVTickets. SortBy(ASPxGVTickets. Columns[ddlSortField. SelectedItem. Value. Trim()], DevExpress. Data. ColumnSortOrder. Descending);

