Data from the ComboBox in the DataGrid shows

Source: Internet
Author: User

Problem Description: Set the ComboBox control in the DataGrid and bind it to the corresponding data, if the newly added line is already set the value of the field, then it will be displayed in the ComboBox control, but append a blank line in advance, and then set the value in the data corresponding to the row, The corresponding data is not displayed in the ComboBox control.

This problem tortured me for several days, try to Itemsource to initialize the binding before it, no, the binding element type changes also not, finally in StackOverflow, a reply to the point of waking me: you should raise the PropertyChanged event on the Hourlyrates property after populating the list in the Foreach loop. Also, set the Mode of the ComboBox SelectedItem binding to TwoWay.

So I set the value of the binding mode to TwoWay after the execution of a bit, the data show out!!!

Record it for forgetting.

Data from the ComboBox in the DataGrid shows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.