Hi when I am trying to use the DataGridViewAutoFilter function in my .net 3.5 windows forms application.
I get the following message
"Operation can only be performed on cells that belong to a DataGridView control"
Can any one help me????
Thank you again in advance.
SOURCE CODE ***
dataGridViewDowntime.BindingContextChanged += new EventHandler(dataGridViewDowntime_BindingContextChanged);
CalculatedDowntime.DefaultView.Sort = "SiteName ASC, Engine Number ASC";
dataGridViewDowntime.DataSource = CalculatedDowntime.DefaultView;
private void dataGridViewDowntime_BindingContextChanged(object sender, EventArgs e)
{
if (dataGridViewDowntime.DataSource == null) return;
foreach (DataGridViewColumn col in dataGridViewDowntime.Columns)
{
col.HeaderCell = new DataGridViewAutoFilter.DataGridViewAutoFilterColumnHeaderCell(col.HeaderCell);
}
dataGridViewDowntime.AutoResizeColumns();
}
END OF SOURCE CODE ***