I have two columns in my grid:
Name(Textbox) ---- ParentList(combobox).
A ----------------------- It sh
That's easy to achieve if you slightly adapt your data type class... I've had to guess at the type of your ParentList
because you didn't show it:
private List allItems = GetAllItems();
public ObservableCollection ParentList
{
get { return parentList; }
set
{
parentList = value;
NotifyPropertyChanged("ParentList");
}
}
public string Name
{
get { return name; }
set
{
name = value;
NotifyPropertyChanged("Name");
ParentList = new ObservableCollection(allItems.Where(i => IsFiltered(i)));
}
}
private bool IsFiltered(string item)
{
// implement your filter condition here
return item.StartsWith("A");
}
So the basic idea is that you hold a private collection of all the possible values... this remains unchanged. Each time the Name
property is changed, we create a new ParentList
dependant on some filtering condition in the IsFiltered
method.