Welcome to Catalyst Blogs Sign in | Join | Help
Dynamic Data Filtering on CodePlex

Last month while I was up in Redmond I meet with the members of the ASP.NET Dynamic Data team and we talked about how to resolve several issues.  The main focus was to remove the need for Reflection to access non-public framework members.  Based on these changes I am now comfortable with the project and I am publishing the code to the community through CodePlex. 

The URL to the CodePlex project is http://www.codeplex.com/DynamicDataFiltering.  I am looking for contributors if anyone is interested in helping out.

Posted: Wednesday, August 06, 2008 1:50 PM by jheyse
Filed under: , ,

Comments

qualia said:

Looks like a great extension for DynamicData - but could I have just a little word of tuition?

I'm trying to use NotNullOrEmptyParameter - I have it in Parameters collection of DynamicLinqDataSource, set its Name, DefaultValue and I would think it should weed out rows with Field(Name) set to null. I can see it added to WhereParameters in OnSelecting event of datasource (of course), but on influence on result set?

# August 7, 2008 10:05 AM

Tatsky said:

Hi There

I have been trying out your code, and think it is great.  The degree of flexibility in filtering is fantastic.

I have a problem however, that maybe you could shed some light on?

I noticed that when the DynamicFilterForm is bound, a query is executed against my DB to retrieve all rows.  If there are foreign keys, then all foreign key tables are joined.  This makes for a slow page load with large numbers of rows.

Setting A break point in the OnSelecting method in the DynamicLinqDataSourceView shows that on the initial page load, when the DynamicFilterForm binds, the LinqDataSourceSelectEventArgs Arguments have values of MaximumRows 0, SortExpression="", StartRowIndex=0.   However, on subsequent post backs the values reflect the pagesize, startrowindex and sortexpression of the gridview.  This results in a much quicker page load on postback.

Can you point me in the right direction as to where I should look to improve the initial page load by reducing the number of rows returned when the DynamicFilterForm is first bound.

Many thanks, and good work

Tatsky

# August 12, 2008 5:56 PM

Tatsky said:

Hi again

After my post yesterday I have played around with the code some more, and have implimented the following overide in the DynamicFilterForm

       protected override DataSourceSelectArguments CreateDataSourceSelectArguments()

       {

         DataSourceSelectArguments args = base.CreateDataSourceSelectArguments();

         args.MaximumRows = 1;

         return args;

       }

This ensures that when the FilterForm binds, only 1 row is returned from the Database.  This has solved the issue I was having.

Can you see any obvious problem with doing this?

Thanks

Tatsky

# August 13, 2008 3:34 AM

jheyse said:

Tatsky,

I have been looking into your issues and have been able to reproduce it.  After some testing, I don't believe that the DynamicFilterForm needs to select from the DataSource at all.  Since that is the case I have override the PerformSelect() method and removed the base.PerformSelect() call which produces & executes the query.  I will add this change into my next release to CodePlex sometime next week (hopefully).

Also, to correct the foreign key lazy loading issue add the following code to your Page_Load.

DynamicDataManager1.RegisterControl(GridView1);

Josh Heyse

# August 26, 2008 4:23 PM

Rob G said:

Josh,

This looks like an great addition to DynamicData projects, but from reading the blog posts and comments, I get the impression that I'm missing something.  Your AdventureWorks sample project has a separate folder for "Products" and has a customized Search page there.  This seems like it's counter to the purpose of "Dynamic" data.  Is there a way to drop a DynamicFilterForm on the List.aspx page and have a filter form for every table without having to hard code it for each table?

Thanks for the great control and any help that you can provide.

# September 4, 2008 9:42 AM

jheyse said:

Rob,

The current implementation requires that the DynamicFilterForm explicitly specify the columns to be filtered.  This feature was developed first due to project requirements.  

I am working on a DynamicFilterRepeater which will use FilterHints, similar to the UIHints for editable controls in Dynamic Data.  This will allow you to drop a control on the List.aspx page.  I should have my next release out with the DynamicFilterRepeater control out this weekend or early next week.

Josh

# September 4, 2008 10:58 PM

Eslam said:

How can i fill dropdownlist  to search with primary key

# September 16, 2008 7:58 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS