本文介绍了Silverlight Datagrid SelectedIndex不变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的Silverlight应用程序中,我的数据网格中有一个组合框绑定到一个类.
当我更改组合框时,可以获取该类的索引,但是当我以编程方式更新该类时,组合框并没有改变
请帮我解决这个问题. .

Hi,
In my silverlight application, I have a combobox in my datagrid that binds to a class.
When I change the combobox, I can get the Index to the class, But the combobox doesn''t change when I update the class programmatically
Please Help me to sort this out. .

<data:datagridtemplatecolumn header="Sale Unit" width="80" xmlns:data="#unknown">
    <data:datagridtemplatecolumn.celleditingtemplate>
        <datatemplate>
            <combobox itemspanel="{Binding RelativeSource={RelativeSource Self}}" datacontext="{Binding}" selectedindex="{Binding Path=cursunit,Mode=TwoWay}" keydown="ComboBox_KeyDown" loaded="ComboBox_Loaded" selectionchanged="ComboBox_SelectionChanged">
            <comboboxitem content="BOX" />
            <comboboxitem content="STRIP" />
            <comboboxitem content="PEICE" />
            </combobox>
        </datatemplate>
    </data:datagridtemplatecolumn.celleditingtemplate>
</data:datagridtemplatecolumn>

推荐答案


这篇关于Silverlight Datagrid SelectedIndex不变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 08:38
查看更多