.xaml
<Grid>
<dxg:LookUpEdit Name="lookUpEdit1"
DisplayMember="ProductName"
ValueMember="ID"
AutoPopulateColumns="False"
AutoComplete="True"
IncrementalFiltering="True"
ImmediatePopup="True"
IsPopupAutoWidth="False"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="200" Margin="10">
<dxg:LookUpEdit.PopupContentTemplate>
<ControlTemplate>
<dxg:GridControl Name="PART_GridControl">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="ProductName"/>
<dxg:GridColumn FieldName="UnitPrice"/>
<dxg:GridColumn FieldName="Quantity"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True"/>
</dxg:GridControl.View>
</dxg:GridControl>
</ControlTemplate>
</dxg:LookUpEdit.PopupContentTemplate>
</dxg:LookUpEdit>
</Grid>
MainWindow_Loaded{
lookUpEdit1.ItemsSource = new Product("ad", "1", 5, 100);
}
class Product
{
public string ProductName { get; set; }
public string ID { get; set; }
public double UnitPrice { get; set; }
public int Quantity { get; set; }
public Product(string productName, string id, double unitPrice, int quantity)
{
ProductName = productName;
ID = id;
UnitPrice = unitPrice;
Quantity = quantity;
}
}
正如你看到的代码。如您所见,我无法填写您。我正在等待您的帮助..