Note that there are some explanatory texts on larger screens.

plurals
  1. POFiltering a dataset in wpf
    primarykey
    data
    text
    <p>I am developing a WPF dictionary app. I have a listbox and a text box in my XAML code, based on the user input in the text box the Dataset must get filtered and the list box must only show the relevant rows. For example: if the user types in the 't' in the text box the listbox must only show words like 'television My problem is that when the form loads the listbox gets filled with 50 words, but when I type anything in the text box, the listbox becomes blank. I have tried filtering the Dataset itself using , but always getting errors can someone help me? How can I do that?</p> <p><strong>my code is here</strong></p> <pre><code>using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Data; using System.Data.OleDb; using System.ComponentModel; namespace DictionaryM { /// &lt;summary&gt; /// Interaction logic for Dictionary.xaml /// &lt;/summary&gt; public partial class Dictionary : Window { public ICollectionView view; public Dictionary() { InitializeComponent(); BindData(); } public void BindData() { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\CellBiology.mdb;Persist Security Info=True"); con.Open(); string sql = "Select Word from Dictionary"; OleDbCommand cmd = new OleDbCommand(sql, con); OleDbDataAdapter da = new OleDbDataAdapter(cmd); DataSet ds = new DataSet(); try { da.Fill(ds, "Word"); listBox1.DataContext = ds; } catch (Exception ex) { label1.Content = ex.Message; } private void textBox1_TextChanged(object sender, TextChangedEventArgs e) { // i dont know what will i code here? } } thanks everyone who response this question </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload