|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DgvFilterPopup;
namespace DgvFilterPopupDemo {
public partial class Sample3 : DgvFilterPopupDemo.Sample0 {
public Sample3() {
InitializeComponent();
}
private void Sample3_Load(object sender, EventArgs e) {
InitGrid();
DgvFilterManager fm = new DgvFilterManager();
// Using the ColumnFilterAdding event, you may force your preferred filter,
// BEFORE the FilterManager create the predefined filter. This event is
// raised for each column in the grid when you set the DataGridView property
// of the FilterManager.
fm.ColumnFilterAdding += new ColumnFilterEventHandler(fm_ColumnFilterAdding);
fm.DataGridView = dataGridView1; // this raises ColumnFilterAdding events
// After column filters creation however, you can overwrite the created filter.
fm["CustomerID"] = new DgvComboBoxColumnFilter();
}
void fm_ColumnFilterAdding(object sender, ColumnFilterEventArgs e) {
switch (e.Column.Name){
case "ShipVia":
case "OrderDate":
case "Freight":
e.ColumnFilter = new DgvComboBoxColumnFilter();
break;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm a graduate in Computer Science.
I work with Metatrader MQL4,MQL5 / C# / Asp.Net / Windows Forms / SQL Server / Access / VBA / HTML / CSS / Javascript / classic C/C++.
I also like writing songs and playing around with my band
Diversamente Rossi.
This is the video of the song
Un'altra estate from the album
L'immobile disegno.
"Short code, good code"