【发布时间】:2013-08-27 16:00:31
【问题描述】:
我正在使用 devexpress,我想与 Listbox 进行绑定,但出现错误。这是我的代码:
<ListBox x:Name="_list" >
<ListBox.ItemTemplate>
<DataTemplate>
<dxd:LayoutPanel
Caption="{Binding nameList}"
AllowHide ="False" AllowFloat="False"
GotFocus="panel_GotFocus" >
<TextBox Text="Hello" />
</dxd:LayoutPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
使用此代码,Caption {Binding nameList} 为空。
我试过了。
<ListBox x:Name="_list" >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBox Text="{Binding nameList}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
在这种情况下,TextBox中的文本是正确的,我需要使用第一个代码。
【问题讨论】:
-
您至少应该在此处提及您正在使用 DevExpress。
标签: wpf binding listbox devexpress