DatagridView Column Filter raises nothing exception when switching to where column filter type

Answered
1
0

Hi,

I added a check box and tried to change filter panel type in runtime and re-assign filter to columns in the datagridview.
Only after showing the simple panel – even if no filters are applied – and then checking the check box to switch filter panel type, a system null reference exception is raised as per pic attached.

This error is vulnerable to any error handling manner.

Could you please advise what to do?

  • You must to post comments
Best Answer
0
0

Mohsen,

can you please share the exact changes you made to the extension? I´ll then check and it to the original sources at GitHub.
You can post them here or send to supportATwisej.com

TIA
Frank

  • Mohsen Ismail
    Nothing special. Just commented out as following in “SimpleColumnFilterPanel” class: private void SimpleColumnFilterPanel_Disposed(object sender, EventArgs e) { //this.DataGridViewColumn.DataGridView.Sorted -= Rows_Sorted; //this.DataGridViewColumn.DataGridView.Rows.CollectionChanged -= Rows_CollectionChanged; } Because DataGridViewColumn and DataGridView there are returning nothing. Now working like a charm. Thanks
  • Frank (ITG)
    Thanks, I´ll add it to the next ColumnFilter release. Best regards, Frank
  • You must to post comments
0
0

Hi again,
Inspected the code of the extension after downloading from github.
Now solved after adjusting the source code and attach the extension project as dependency to my project instead of nuget package.
Thanks.

PS: For instance of sharing the exception was issued in the SimpleColumnFilterPanel_Disposed of SimpleColumnFilterPanel.cs as the datagriview and datagridviewcolumn object were already disposed in SetShowFilter of  ColumnFilter.cs .

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.