ADGV with Entity Framework and make filters fast


Great work with the ADGV! :)

I have used the Entity Framework to generate model class from the database. I use this model as the datasource of my ADGV. The model has correct data types for the columns but ADGV does not detect that and shows me text filters for all columns.

Take for example the "amount_local_netto" column in the attached images. It has the type "System.Decimal" but it shows the Text filter.

I have noticed one thing though. If I deliberately change its column.ValueType property to typeof(decimal) in Designer.cs when the columns are being added, then it shows me the correct filter.

What could be the problem here? Also, for too many distinct values in a column, the drop-down shows after a big lag. Do you have any good idea to make that faster?

Thank you and I look forward to your response.

file attachments


burni83 wrote Feb 11, 2015 at 3:26 PM

maybe because the type is decimal? ( is the same as Nullable) and not decimal

in the code the check is this.DataType == typeof(Decimal)

syedaliammar wrote Feb 12, 2015 at 12:20 PM

I did the following:
  1. Changed data type of amount_local_netto property to "decimal" in the TableName.cs file2. Set Nullable property of amount_local_netto to False in the table model
Did not work. I also tried adding a check for "this.DataType == typeof(Nullable)" in the ADGV source, then rebuilt the DLL and added it to my project again which also did not work.

Is there anything that you might need from me?


Zubyme wrote Feb 13, 2015 at 12:07 AM

if you can please send me you source code and some sample data for filtering

syedaliammar wrote Feb 16, 2015 at 9:21 AM

Hi Zuby,Since the max upload size for an attachment is 4 mb, I cannot upload my project which is 10 mb. I am now sending it to you per email.

Thank you!

syedaliammar wrote Feb 16, 2015 at 9:29 AM

Infact, it is better that I put it on dropbox with public access. Here's the linkThanks for helping!

Zubyme wrote Feb 17, 2015 at 7:39 AM

Thank you. I will post new release as soon as I can0.1.1.0