We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Filtering Errors

Thread ID:

Created:

Updated:

Platform:

Replies:

119492 Jun 30,2015 08:56 AM Sep 4,2015 04:38 AM WPF 9
loading
Tags: SfDataGrid
Ari Case
Asked On June 30, 2015 08:56 AM

I'm having issues using the built-in filter feature for the SfDataGrid.

Whenever I try to filter any field I get this error:

"An unhandled exception of type 'System.Data.EvaluateException' occurred in System.Data.dll

Additional information: Cannot find column [[dummy_column]]."

Do you have any idea why this is happening?

Elavarasan M [Syncfusion]
Replied On July 1, 2015 10:16 PM

Hi Ari,


Thank you for using Syncfusion products.


We have analysed your query and we are not able to reproduce the reported issue. Could you please share more details whether you are using the indexer binding or what type of column you are using or what kind of collection you are using (ObservableCollection, dynamic or DataTable) and the version you are using. This would help us provide the better resolution to you.


Please let us know if you have any queries.


Thanks,
Elavarasan M


Ari Case
Replied On July 2, 2015 09:36 AM

I'm binding a DataView to the SfDataGrid. 

The DataView is instantiated to an object that inherits properties of a DataTable, like so:


  dvRisk = new DataView(customTable);
           

  sfDataGrid.ItemsSource = dvRisk;

The column types  I'm using for the sfDataGrid are simply GridTextColumns, GridCurrencyColumns and GridComboBoxColumns.

Ari Case
Replied On July 2, 2015 09:39 AM

And the version of Syncfusion I'm using is 13.1400.0.21

Elavarasan M [Syncfusion]
Replied On July 3, 2015 08:22 AM

Hi Ari,
Thank you for your update.

From your code snippet, we have prepared the sample by using DataView as items source and with GridTextColumn, GridComboBoxColumn and GridCurrencyColumns. But we are not able to reproduce the reported issue by clicking the filtering button and by filtered the records. From the provided stack trace, we suspect that you are using the dummy column (the column not defined the DataTable) in the sfdatagrid. If you are using the dummy column in grid with datatable, then the exception will throw (behaviour of DataTable) by filtering the column and the exception will not be thrown by clicking the filter toggle button itself. Could you please share whether you are using the dummy column to the grid? If your scenario is different, please modify the below attached sample and revert us. This would help us to provide you resolution at the earliest.

Please find the sample from the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/119492/ze/SfDataGridSample-802244170
Please let us know if you have any queries.
Thanks,
Elavarasan M

Ari Case
Replied On July 6, 2015 09:35 AM

Hi,

The DataView that I'm using does have the field names that my error message claims it cannot find when I try to filter, I'm looking at the DataView structure while debugging so I can confirm that this is true:

  • budget_status
  • budget_year
  • total_risk
  • total_forecast
  • risk_comment
  • execution_comment
  • budget_type

Here's an example of how one of these columns is initialized in the Designer.cs (I've bolded the mapping names below):

this.columnbudget_status = new global::System.Data.DataColumn("budget_status", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnbudget_status);

this.columntotal_forecast = new global::System.Data.DataColumn("total_forecast", typeof(decimal), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columntotal_forecast);

I mean it just doesn't make sense to bind directly to something and have the built-in filter not work because it cannot find these columns. 

Elavarasan M [Syncfusion]
Replied On July 7, 2015 11:41 PM

Hi Ari,

Sorry for the inconvenience caused.

In your attached code snippet, you have created the new column with the previously added column mapping name and by adding this, it throws the exception as “Duplicate name exception – A column name already exists in datatable” and the columns in datatble should not be same name. You need to create the new column with the new mapping name and this need to differ from others. We have created the sample based on this and please find the sample from below location. If your scenario is different, please revert us by modify the sample and this will be helpful to provide the better resolution to you.

Sample location: http://www.syncfusion.com/downloads/support/forum/119492/ze/SfDataGridSample64366030

We don’t have support for use same MappingName for multiple columns. Since it leads to be a crash in multiple scenarios. So we suggest you to use different MappingName but you can use the same value for multiple columns. You can achieve this using Displaybinding and ValueBinding in GridColumn. Please refer the below code snippet to achieve your requirement.

Code Snippet:

<syncfusion:GridTextColumn MappingName="Meter" />

<syncfusion:GridTextColumn DisplayBinding="{Binding Meter,

Converter={StaticResource converter}}"

MappingName="Inch"

UseBindingValue="True"

ValueBinding="{Binding Meter,

Converter={StaticResource converter}}" />

Sample:

http://www.syncfusion.com/downloads/support/forum/119492/ze/SfDataGridSample340835505

Please refer the below documentation link to know more about DisplayBinding and ValueBinding.

UG Link: http://help.syncfusion.com/ug/wpf/index.html#!Documents/differencebetweendisplaybindingvaluebindingandmappingnamepropert.htm

Please let us know if you have any queries.

Thanks,
Elavarasan M


Pavel A.Vinogradov
Replied On September 3, 2015 06:25 AM

Hi!

Today same error happened  in my application, but exception raised not with all columns. I think the only difference between columns was in the field names. This exception raised only with columns containing underscore symbol in field name (like TAG_NUM). 
Sorry for my bad english

Thank you very much!
Pavel A.Vinogradov

Pavel A.Vinogradov
Replied On September 3, 2015 09:24 AM

I attached a sample where we have a sfDataGrid attached to DataTable with 4 fields, two with underscore in field name and two without it.

Thanks.


Attachment: UnderscoreSample_22fd0c6f.rar

Elangovan S [Syncfusion]
Replied On September 4, 2015 04:38 AM

Hi Pavel,
We were able to reproduce the reported issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
Please let me know if you have any question.
Regards,
Elangovan S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;