Ticket AS3049
Visible to All Users

Display the filter in the AutoFilterRow after the view's layout has been restored

created 19 years ago

When restoring the layout of a grid out of a stream / registry the current filter is placed in the filter panel, but NOT in the autofilter row.
NOTE:

  1. All is working fine when entering a text in the autofilter row, so that the filter criteria is "like"
  2. Nothing is displayed when selecting a value from the filter drop down list
Comments (2)
DevExpress Support Team 18 years ago

    Workaround
    Save/restore the AutoFilterRow's values via events. Here is the necessary code for the GridLookUp in-place editor:

    C#
    using DevExpress.XtraEditors; using DevExpress.XtraGrid; using DevExpress.XtraGrid.Columns; using DevExpress.XtraGrid.Views.Grid; ArrayList filterList; bool isRestoringFilter = false; private void repositoryItemGridLookUpEdit1View_ColumnFilterChanged(object sender, EventArgs e) { GridView lookupView = sender as GridView; if(isRestoringFilter || lookupView.FocusedRowHandle != GridControl.AutoFilterRowHandle) return; filterList = new ArrayList(); foreach(GridColumn column in lookupView.Columns) { object filter = lookupView.GetRowCellValue(GridControl.AutoFilterRowHandle, column.FieldName); if(filter != null) { ColumnAutoFilterInfo info = new ColumnAutoFilterInfo(); info.FieldName = column.FieldName; info.Filter = filter; filterList.Add(info); } } } private void repositoryItemGridLookUpEdit1_Popup(object sender, EventArgs e) { if(filterList == null || filterList.Count == 0) return; isRestoringFilter = true; GridLookUpEdit editor = (GridLookUpEdit)sender; GridView lookupView = editor.Properties.View; lookupView.FocusedRowHandle = GridControl.AutoFilterRowHandle; foreach(ColumnAutoFilterInfo info in filterList) lookupView.SetRowCellValue(GridControl.AutoFilterRowHandle, info.FieldName, info.Filter); isRestoringFilter = false; } public class ColumnAutoFilterInfo { public string FieldName; public object Filter; }
    DevExpress Support Team 17 years ago

      Hello Georg,
      Please add this code line to the entry point of your application to enable this feature in DXperience v8.1.1 or higher:

      C#
      static void Main() { GridView.GuessAutoFilterRowValuesFromFilterAfterRestoreLayout = true;

      If we get positive feedback on this change, we'll make this feature permanent in DXperience v2008 vol 2.
      Thanks,
      Nick

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.