The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi, I'm trying to load data into a ComboBoxBase using this code. I only get one row. The samples only have mdb data sources. I would ultimately like the choice picked in the combo to drive the items displayed in adjacent text boxes, so that I have a kind of record browser.
Can you help?
Thanks,
this.dsList = new DataSet(); this.dsList.ReadXml("List.xml"); this.cmbPortfolios.DataBindings.Add("Text", this.dsList.Tables["Lists"], "description");
ADAdministrator Syncfusion Team January 29, 2007 05:43 PM UTC
Hi Dimitri.
The Combobox doesn't have a DataMember property - instead it has a DisplayMember and ValueMember property. The DisplayMember of a Combobox gets or sets a string that specifies the property of the data source whose contents you want to display. The ValueMember property determines which value gets moved into the SelectedValue of the Combo Box.
In the example, whenever the user selects a Customer by "Customers.CompanyName", the SelectedValue is the "Customers.CustomerID". Whenever the SelectedValue changes, the data-binding moves the new value into the Customer object.
// Setup the combobox view and display-, value member comboBox.DataSource = dsView; comboBox.DisplayMember = "Customers.CompanyName"; comboBox.ValueMember = "Customers.CustomerID";
Best Regards, Haneef
ADAdministrator Syncfusion Team January 30, 2007 02:09 PM UTC
Thanks Haneef, The examples use a database - I'm not having a lot of luck using xml - is there a sample driven totally by xml?
>Hi Dimitri.
The Combobox doesn't have a DataMember property - instead it has a DisplayMember and ValueMember property. The DisplayMember of a Combobox gets or sets a string that specifies the property of the data source whose contents you want to display. The ValueMember property determines which value gets moved into the SelectedValue of the Combo Box.
In the example, whenever the user selects a Customer by "Customers.CompanyName", the SelectedValue is the "Customers.CustomerID". Whenever the SelectedValue changes, the data-binding moves the new value into the Customer object.
// Setup the combobox view and display-, value member comboBox.DataSource = dsView; comboBox.DisplayMember = "Customers.CompanyName"; comboBox.ValueMember = "Customers.CustomerID";
Best Regards, Haneef
ADAdministrator Syncfusion Team January 31, 2007 07:51 PM UTC
Hi Dimitri,
Please try the sample and let me know if you are looking something different. comboBox.zip