c# - XamDataGrid 中的 XamComboBoxField 为空
问题描述
请帮助xamdatagrid的组合框字段的下拉列表中没有数据,这唯一表明它是一个集合
我有这门课
public class AvisTIlGrid {
public int BureaoOrdreNr { get; set; }
public decimal Total { get; set; }
public int UgeavisID { get; set; }
public string bureauOrdreNr { get; set; }
public List<Fejl> fejl { get; set; }
}
public class Fejl
{
private string fejltekst;
public string FejlTekst { get => fejltekst; set => fejltekst = value; }
}
在 Dao 类中,fejl 填充了来自 FejlTekstTable 的数据
fejl = diMPdot.tblFejlTeksts.Select( f => new Fejl()
{
FejlTekst = f.FejlTekst
}).ToList()
查询的结果如下所示,它是 List Ingen valgt Bestilt for sent - ikke bragt Ordre ikke modtaget Glemt annonce DLU har fremsendt forkert matr。Vi har indrykket forkert matr。Forkert farve Forkert 放置 Forkert annonce 格式 Glemt farve
在我的视图类中,我有一个 XamDataGrid,其中指定了一个 ComboBoxField,但是当我运行代码时,下拉菜单中没有数据
<igWPF:ComboBoxField Name="fejl" DisplayMemberPath="FejlTekst" Label="Fejl" >
</igWPF:ComboBoxField>
解决方案
<igWPF:ComboBoxField Name="fejl" Label="Fejl" DisplayMemberPath="FejlTekst" ValuePath="FejlTekst" BindingType="Unbound" Visibility="Collapsed">
<igWPF:ComboBoxField.Settings>
<igWPF:FieldSettings>
<igWPF:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igWPF:XamComboEditor}">
<Setter Property="ItemsSource" Value="{Binding DataItem.fejl}"/>
</Style>
</igWPF:FieldSettings.EditorStyle>
</igWPF:FieldSettings>
</igWPF:ComboBoxField.Settings>
</igWPF:ComboBoxField>
推荐阅读
- java - 如何将json值转换为键?基本上我想将一个键的值用作“键”,将另一个键的值用作值
- python-3.x - 从scrapy Request获得401响应
- python - 当请求模块不可用时,如何从 Python v2.7.13 进行 API 调用
- excel - 使用 NetworkDays.Intl 作为 Excel VBA 中的复杂公式排除非工作时间?
- python - 我可以使用 python 代码来控制连接到 Raspberry 的 LED,但是使用 C 它不起作用
- c# - 新的 NWRfcSession() System.OutOfMemoryException
- stm32ldiscovery - LIS2DW12加速度计倾斜角检测使用STM32L496AG
- visual-studio-code - WSL 在 VSCode 中失去连接
- android - Flutter_blue -> 连接错误:[onConnectionStateChange] 状态:133 新状态:0
- python - 无法访问 tkinter 函数之外的列表数据