Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Filtering the SQL Data Source View modes: 
User avatar
Member
Member
dchaffin-dreamcc - 10/20/2011 4:11:00 PM
   
Filtering the SQL Data Source
I have the SQL Data Source set up on a page, accessing an external database and supplying data to a Basic Repeater with a Universal Pager. This all works fine. What I want to do now is filter this data. I've seen the material about creating custom filters, but there is no option to attach ANY filter to the SQL Data Source web part.

Does anyone know of a way to do this? I've searched the forums and Google looking for help, but to no avail thus far.

Thanks!

User avatar
Member
Member
kentico_michal - 10/30/2011 12:49:40 AM
   
RE:Filtering the SQL Data Source
Hello,

Regrettably, it is not possible to attach a custom filter to SQL Data source web part. You will need modify the SQL Data source web part, add some controls that allow users to filter data and then dynamically change the QueryText property of data source based on what a user has selected.

Best regards,
Michal Legen

User avatar
Member
Member
dchaffin-dreamcc - 10/31/2011 12:08:00 PM
   
RE:Filtering the SQL Data Source
Do you know of any tutorials/books/etc. that might demonstrate this process? I'm not new to ASP.NET, but I am to Kentico.

Thanks!

User avatar
Member
Member
kentico_michal - 11/1/2011 8:37:46 AM
   
RE:Filtering the SQL Data Source
Hello,

Documentation related to web part's modifications can be found here: Modifying web part behavior.

You can add some textbox to SQL Data source web part (~\CMSWebParts\DataSources\SQLDataSource.ascx) to let users enter some filtering value. In the code behind you need to based on specified value change the SQLDataSource.QueryText so that it contains appropriate Where condition.

Best regards,
Michal Legen