private void SetDefaultFilters(string symbolname) { DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(@"([SYMBOLNAME] = '" + symbolname + "')", "Symbol:" + symbolname); gridView1.ActiveFilter.Clear(); gridView1.ActiveFilter.Add(gcBrowseSymbolName, fltr); gridView1.ActiveFilterEnabled = true; }
void gridView2_ShowFilterPopupListBox(object sender, FilterPopupListBoxEventArgs e) { if (e.Column.FieldName == "DefaultValue") { Dictionary <string, List <object> > values = new Dictionary <string, List <object> >(); DevExpress.XtraEditors.Controls.ComboBoxItemCollection col = new DevExpress.XtraEditors.Controls.ComboBoxItemCollection(new DevExpress.XtraEditors.Repository.RepositoryItemComboBox()); foreach (FilterItem it in e.ComboBox.Items) { if (!it.Text.StartsWith("(")) { string t = it.Text; if (t.StartsWith("Value")) { t = NumericEditor.GetDisplayText(t, true, Plugin); } if (!values.ContainsKey(t)) { values.Add(t, new List <object>()); } values[t].Add("[DefaultValue] = '" + it.Value + "'"); } } foreach (string t in values.Keys) { DevExpress.XtraGrid.Columns.ColumnFilterInfo cfi = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(String.Join(" OR ", values[t]), t); col.Add(new FilterItem(t, cfi)); } e.ComboBox.Items.Clear(); e.ComboBox.Items.Add(new FilterItem("(All)", new DevExpress.XtraGrid.Columns.ColumnFilterInfo())); e.ComboBox.Items.AddRange(col); } }
private void RefreshSelection() { bool filteractive = false; string filterstring = string.Empty; // refresh based on current filtering gridView1.ActiveFilter.Clear(); if (comboBoxEdit1.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Carmodel] = '" + comboBoxEdit1.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Car model"); gridView1.ActiveFilter.Add(gcCarmodel, fltr); } if (comboBoxEdit2.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Engine] = '" + comboBoxEdit2.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Engine"); gridView1.ActiveFilter.Add(gcEngine, fltr); } if (comboBoxEdit3.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([OBD] = '" + comboBoxEdit3.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "OBD type"); gridView1.ActiveFilter.Add(gcOBD, fltr); } if (comboBoxEdit4.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Mapsensor] = '" + comboBoxEdit4.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Mapsensor"); gridView1.ActiveFilter.Add(gcMapsensor, fltr); } if (comboBoxEdit5.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Injectors] = '" + comboBoxEdit5.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Injectors"); gridView1.ActiveFilter.Add(gcInjectors, fltr); } if (comboBoxEdit6.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([stage] = '" + comboBoxEdit6.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Stage"); gridView1.ActiveFilter.Add(gcStage, fltr); } /*** set filter ***/ gridView1.ActiveFilterEnabled = filteractive; }
private void SetDefaultFilters() { gridViewSymbols.ActiveFilter.Clear(); // clear filter if (!IsSoftwareOpen()) { /*** set filter ***/ //DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(@"([Flash_start_address] > 0 AND [Flash_start_address] < 524288)", "Only symbols within binary"); DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo("[Flash_start_address] LIKE '0_____' AND [Length] <> '000000'", "Only symbols within binary"); gridViewSymbols.ActiveFilter.Add(gcSymbolsAddress, fltr); } gridViewSymbols.ActiveFilterEnabled = false; }
private void SetDefaultFilters(string symbolname) { DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(@"([SYMBOLNAME] = '" + symbolname + "')", "Symbol:" + symbolname); gridView1.ActiveFilter.Clear(); gridView1.ActiveFilter.Add(gcBrowseSymbolName, fltr); gridView1.ActiveFilterEnabled = true; }
} //end method SwitchViewMode public void SetFilter(String column, String filterString, String filterName) { DevExpress.XtraGrid.Columns.ColumnFilterInfo filter = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterString, filterName); gridViewServices.Columns[column].FilterInfo = filter; }//end method SetFilter
private void SetDefaultFilters() { DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(@"([Flash_start_address] > 0 AND [Flash_start_address] < 1048576)", "Only symbols within binary"); gridViewSymbols.ActiveFilter.Clear(); gridViewSymbols.ActiveFilter.Add(gcSymbolsAddress, fltr); /*** set filter ***/ gridViewSymbols.ActiveFilterEnabled = true; }
private void SetDefaultFilters() { if (m_appSettings.ShowAddressesInHex) { DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(@"([Flash_start_address] <> '000000')", "Only symbols within binary"); gridViewSymbols.ActiveFilter.Clear(); gridViewSymbols.ActiveFilter.Add(gcSymbolFlash, fltr); gridViewSymbols.ActiveFilterEnabled = true; } else { DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(@"([Flash_start_address] > 0)", "Only symbols within binary"); gridViewSymbols.ActiveFilter.Clear(); gridViewSymbols.ActiveFilter.Add(gcSymbolFlash, fltr); gridViewSymbols.ActiveFilterEnabled = true; } }
private void RefreshSelection() { bool filteractive = false; string filterstring = string.Empty; // refresh based on current filtering gridView1.ActiveFilter.Clear(); if (comboBoxEdit1.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Carmodel] = '" + comboBoxEdit1.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Car model"); gridView1.ActiveFilter.Add(gcCarmodel, fltr); } if (comboBoxEdit2.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Engine] = '" + comboBoxEdit2.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Engine"); gridView1.ActiveFilter.Add(gcEngine, fltr); } if (comboBoxEdit3.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([OBD] = '" + comboBoxEdit3.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "OBD type"); gridView1.ActiveFilter.Add(gcOBD, fltr); } if (comboBoxEdit4.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Mapsensor] = '" + comboBoxEdit4.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Mapsensor"); gridView1.ActiveFilter.Add(gcMapsensor, fltr); } if (comboBoxEdit5.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([Injectors] = '" + comboBoxEdit5.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Injectors"); gridView1.ActiveFilter.Add(gcInjectors, fltr); } if (comboBoxEdit6.SelectedIndex > 0) { // add to filter filteractive = true; filterstring = @"([stage] = '" + comboBoxEdit6.Text + "')"; DevExpress.XtraGrid.Columns.ColumnFilterInfo fltr = new DevExpress.XtraGrid.Columns.ColumnFilterInfo(filterstring, "Stage"); gridView1.ActiveFilter.Add(gcStage, fltr); } /*** set filter ***/ gridView1.ActiveFilterEnabled = filteractive; }