iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
I am trying to use WebCombo with linq bound to a mysql datasource using the Devart data access libraries.
It is very easy to implement WebCombo so that the datasource is of linq, and easily specify the DataTextField and DataValueField..... however, I'm unaware how to implement live search using the said technology.
If our datasource contains hundreds or thousands of entries, we obviously don't want to databind all of the records to the WebCombo control, as this would result in unnecessary SQL overhead. We wish to refine our matches based on the first few characters of user inpurt.
How can I instruct the WebCombo control to implement a custom WHERE clause on the MySQL query so that the WebCombo rows are limited to relevant / matching records?
Thank you
It seems your scenario requires to handle your own query manually, correct (Please correct me if I am wrong)? If that so, you can set AllowAutoQueryHandler to false. With this way, you can also handle your own query when you type something on WebCombo (need to specify MinimumCharToRequest). For sample, about implement those properties and customize with your own query you can refer into this thread. Hope this helps.
Regards,Handy
Thank you. I will try this. Looks to be just what I was looking for.
WebCombo
<ISWebCombo:WebCombo ID="WebCombo1" runat="server" AllowAutoQueryHandler="False" MinCharsToRequest="3" oninitializedatasource="WebCombo1_InitializeDataSource" UseDefaultStyle="true"> <MultipleSelectionSettings AllowBrowseAll="True" Enabled="True" /> </ISWebCombo:WebCombo>
Programmatically
protected void WebCombo1_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e) { if (IsPostBack) { string t = "select * from Customers where CustomerID like '" + e.QueryText+ "%'"; OleDbDataAdapter da1 = new OleDbDataAdapter(t, con); DataTable dt = new DataTable("Customers"); da1.Fill(dt); da1.FillSchema(dt, SchemaType.Mapped); e.DataSource = dt; con.Close(); } WebCombo1.DataTextField = "CustomerID"; WebCombo1.DataValueField = "CustomerID"; }
I am glad that you got what you are looking for. Thank you for your confirmation.
Hi,
Did you accidentally reply without text or something? Unfortunately if you didn't, could you please repost again since the content was empty.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname