Filtering data by "like condition"

I need to filter like this: LIKE ‘%VAR%’ (the SQL way)
I tried this:
sched.Data.Loader.AddParameter(“title”, “%” + txtAgendaFilter + “%”);
where txtAgendaFilter is my textbox which i submitted in my form.
I really don’t know if using “%” it’s supported or not.

is there any other way for doing this?

Hi,
AddParameter only helps to pass attach parameters to the data url, all the filtering has to be done in the Data action.
If you use Linq to Sql, you can do it following way

[code]public ActionResult Index(FormCollection data){

sched.Data.Loader.AddParameter(“title”, txtAgendaFilter);

}
public ContentResult Data(){
var filter = this.Request.QueryString[“title”];

dataset = from ev in dc.Events where ev.Title.Contains(filter) select ev;
//OR
dataset = from ev in dc.Events where SqlMethods.Like(ev.Title, "%"+filter+"%") select ev;
return (new SchedulerAjaxData(dataset));

}[/code]
SqlMethods are defined in System.Data.Linq.SqlClient namespace

thank you very much, I managed to solve the issue by using this code:

(Agendes is custom table I made containing the label of the owner)

Basically when I filter, text is submitted to an action in my controller.
As you can seen I use Data.Parse method
is it your a better solution? I know your solution is triggered client-side (AJAX if I’m not wrong)

Hi,
since the page will be reloaded anyway, its better to load events directly to the scheduler, i.e. with DHXScheduler.Data.Parse.
Separate data action makes sense only if you usе dynamic loading(scheduler-net.com/docs/loading_d … g_datasets)

Ok thanks :wink: