Esempio n. 1
0
 void GridView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     if (IsRowInvisible(e.ListSourceRow))
     {
         e.Visible = false;
         e.Handled = true;
     }
 }
        void _view_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            GridView view   = sender as GridView;
            DataView source = (DataView)view.DataSource;

            e.Visible = !ContainsRow(source, e.ListSourceRow);
            e.Handled = true;
        }
Esempio n. 3
0
 /// <summary>
 /// Sets a custom filter for the grids rows
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void grvLines_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     //Filter out the Result item so that it does not show on the grid
     if ((grvLines.GetRow(e.ListSourceRow) as DB.SYS_DOC_Line).ItemId == ((DB.ITM_BOM_Document)BindingSource.DataSource).ItemResultId &&
         (grvLines.GetRow(e.ListSourceRow) as DB.SYS_DOC_Line).Quantity == ((DB.ITM_BOM_Document)BindingSource.DataSource).QuantityExpectedResult)
     {
         e.Visible = false;
         e.Handled = true;
     }
 }
 private void gridView1_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     if (filterIsActive)
     {
         GridView view      = (GridView)sender;
         int      rowHandle = view.GetRowHandle(e.ListSourceRow);
         e.Visible = !view.IsMasterRowEmptyEx(rowHandle, view.GetRelationIndex(rowHandle, "Detail"));
         e.Handled = true;
     }
 }
        private void orderDetailGridView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            DataRow row = orderDetailDt.Rows[e.ListSourceRow];

            if (Convert.ToInt32(row["UnloadPlaceNumber"]) != currentUnloadPlaceNumber)
            {
                e.Visible = false;
            }

            e.Handled = true;
        }
Esempio n. 6
0
 void View_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     if (!popupOpened)
     {
         return;
     }
     if (_DataSourceWrapper[e.ListSourceRow] is MyObject)
     {
         e.Visible = false;
         e.Handled = true;
     }
 }
Esempio n. 7
0
 private void gridView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     //var dataSource = gridView.DataSource as List<Core.TestItem>;
     //var item = dataSource[e.ListSourceRow];
     ////if (!dataSource[e.ListSourceRow].Tags.Split(',').Contains("其他"))
     ////{
     ////    e.Visible = false;
     ////    e.Handled = true;
     ////}
     //e.Visible = ItemFilter(item);
     //e.Handled = true;
 }
 private void GlobalGridView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     if (MostrarSoloSeleccionados_checkButton.Checked && _selectedDataSourceRowIndeces != null)
     {
         e.Visible = _selectedDataSourceRowIndeces.Contains(e.ListSourceRow);
         e.Handled = true;
     }
     else
     {
         e.Visible = true;
     }
 }
Esempio n. 9
0
        private void gridView2_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            if (showOnlySelected)
            {
                if (!e.Visible && searchControl1.Text != "")
                {
                    return;
                }

                e.Visible = listSelectedRow.ContainsKey((int)dataSource.Rows[e.ListSourceRow]["MaDV"]);
                e.Handled = true;
            }
        }
Esempio n. 10
0
        private void GridView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            DataRow dr = _RowCollection[e.ListSourceRow];

            foreach (var item in _SearchMap)
            {
                if (item.Value.Include((String)dr[item.Key]) == false)
                {
                    e.Visible = false;
                    e.Handled = true;
                    return;
                }
            }

            e.Visible = true;
            e.Handled = true;
        }
        private void ActionFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            string   vendor = goodstypeTableAdapter1.GetDataByDesc(nowViewItem)[0].GDSTYPE_NO;
            TileView view   = sender as TileView;

            DataSet1.REP_GOODSRow row = view.GetDataRow(e.ListSourceRow) as DataSet1.REP_GOODSRow;
            if (row.GDSTYPE_NO == vendor)
            {
                e.Visible = true;
                e.Handled = false;
            }
            else
            {
                e.Visible = false;
                e.Handled = true;
            }
        }
Esempio n. 12
0
 private void gvDetail_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     try
     {
         var currModel = lstbodyModel[e.ListSourceRow];
         if (currModel != null && currModel.Editprop.IsNullOrEmpty() == false && currModel.Editprop.Equals("D"))
         {
             e.Visible = false;
         }
         e.Handled = true;
     }
     catch (Exception ex)
     {
         Utils.Logger.Error(ex.ToString());
         ClsMsg.ShowErrMsg(ex.Message);
     }
 }
Esempio n. 13
0
        private void GridView_CustomRowFilter_external(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            DataRow dr = _RowCollection[e.ListSourceRow];

            // int search
            foreach (var item in _IntSearchMap)
            {
                if (decimal.Parse(dr[item.Key].ToString()) < item.Value.Min || decimal.Parse(dr[item.Key].ToString()) > item.Value.Max)
                {
                    e.Visible = false;
                    e.Handled = true;
                    return;
                }
            }

            // datetime search
            foreach (var item in _DateSearchMap)
            {
                if (((DateTime)dr[item.Key]).CompareTo(item.Value.Min) < 0 || ((DateTime)dr[item.Key]).CompareTo(item.Value.Max) > 0)
                {
                    e.Visible = false;
                    e.Handled = true;
                    return;
                }
            }

            // string search
            foreach (var item in _SearchMap)
            {
                if (item.Value.Include((String)dr[item.Key]) == false)
                {
                    e.Visible = false;
                    e.Handled = true;
                    return;
                }
            }

            e.Visible = true;
            e.Handled = true;
        }
Esempio n. 14
0
 private void gridViewPhong_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     try
     {
         GridView view = sender as GridView;
         if (e.ListSourceRow >= 0 && !String.IsNullOrEmpty(view.FindFilterText))
         {
             String text = view.GetRowCellValue(e.ListSourceRow, colten).ToString();
             String find = view.FindFilterText;
             if (find.Equals(StringHelper.CoDauThanhKhongDau(find)))
             {
                 if (StringHelper.CoDauThanhKhongDau(text.ToUpper()).Contains(StringHelper.CoDauThanhKhongDau(find.ToUpper())))
                 {
                     e.Visible = true;
                     e.Handled = true;
                 }
                 else
                 {
                     e.Visible = false;
                     e.Handled = true;
                 }
             }
             else
             {
                 if (text.ToUpper().Contains(find.ToUpper()))
                 {
                     e.Visible = true;
                     e.Handled = true;
                 }
                 else
                 {
                     e.Visible = false;
                     e.Handled = true;
                 }
             }
         }
     }
     catch { };
 }
Esempio n. 15
0
        void _view_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
        {
            GridView                     view       = (sender as GridView);
            BaseGridController           controller = view.DataController;
            PropertyDescriptorCollection pdc        = null;
            IList source = (IList)view.DataSource;

            if (view.DataSource is ITypedList)
            {
                pdc = (view.DataSource as ITypedList).GetItemProperties(null);
            }
            else
            {
                pdc = TypeDescriptor.GetProperties(source.GetType().GetProperty("Item").PropertyType);
            }
            if (view.FindFilterText == string.Empty)
            {
                ExpressionEvaluator ev = new ExpressionEvaluator(pdc, controller.FilterCriteria);
                e.Visible = !IsEmptyDetail(e.ListSourceRow, controller) && ev.Fit(source[e.ListSourceRow]);
                e.Handled = true;
            }
        }
Esempio n. 16
0
 private void updateCategory_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
 }
Esempio n. 17
0
 private void gvData_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
 }
 private void secondView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e)
 {
     e.Visible = false;
     e.Handled = true;
 }