Pergunta

On a SearchScreen, I have some properties to filter my table results.

  • ComboBox for the month.
  • ComboBox for the year.
  • ComboBox for a customer (based on a query with two parameters, DateBegin, DateEnd)

The third ComboBox need to be filtered to only show customers that are 'active' in the selected period from Month and Year Comboboxes.

I use two properties (Date) named 'prpDateBeginSelected' and 'prpDateEndSelected', linked to my query herself linked to the ComboBox of the customers.

I use the _Changed events on my Month and my Year to assignate the dates to the properties.

When I make my first selection after the screen was loaded, It work and the customer combobox is filtered in the good period. But after, when I change the month or the Year, the customers comboBox don't reload.

I've tried to do a this.qCustomersByPeriod.Refresh(); in my code but no changes.

Thanks for help.

PS : If needed, I can make you a sample to show you the idea.

EDIT : A sample to help you understand me. LS_SearchFiltered.zip (58.6 Mo)

Foi útil?

Solução

It's good that you provided your solution, because I got confused just from the explanation from the post. Indeed the problem with your solution was data binding. You've mistaken the data binding for QueryDataByCustomerAndPeriod.CustomerId it should be QueryCustomersByDate.SelectedItem.Id . Also instead of using generic prpCustomer, you need to use the selected item of QueryCustomersByDate and get the relevant Id. To clarify everything see the screenshots below. Hope this solves your problem.

A note to remember - check carefully your data biding in the View-Model - what links to what.

Problem in QueryDataByCustomerAndPeriod.CustomerId

Correct the binding in QueryDataByCustomerAndPeriod.CustomerId

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top