开发者

Silverlight 3: Bind from a combobox in one datagrid cell to one in another cell

I have a Silverlight datagrid where two of the columns are comboboxes. One of the comboboxes is bound to an unchanging Dictionary and is displaying the list of Keys. For the other combobox, I want to populate it with a hardcoded list of strings based on the Value of the selected item in the first combobox.

A little more context - the Values in the dictionary are strings but they will only have a few different values. There may be 100 keys in the Dictionary but all the values will be either "one", "two" or "three". If a user chooses an item where the Value is "one", the combobox in the other column should let you choose from "Un" and "Uno". If the user chooses an item where the Value is "two", the combobox in the other column should let you choose from "Dos" and "Deux". And so on. The list of values to display is well-known and hard-coded, but it can be represented any way that is convenient - as a Convert开发者_开发知识库er or whatever.

How can I do this?


Was thinking about this wrong. Got it to work by binding the second combobox to the property on the object that the first combobox is setting, and using a converter to convert that value. Looks like I've got a ways to go before I'm thinking in WPF/XAML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜