C
C#16mo ago
Livid

✅ winform databinding

how to i add a integer to a textbox.text
10 Replies
Bailey
Bailey16mo ago
Hi, the only way is to convert it to a string.
SG97
SG9716mo ago
is databinding actually what you want here
Livid
LividOP16mo ago
yes that was a example i have a textbox but i want to add a databind to a instance of a custom class
SG97
SG9716mo ago
look into BindingSource
Livid
LividOP16mo ago
why does datasource no require a object to be a string while databinds in this case does
SG97
SG9716mo ago
I've no idea what you mean, can you post your current code
Bailey
Bailey16mo ago
Data binding overview - WPF .NET
Learn about the different data sources you can add to your project in Windows Presentation Foundation for .NET. Data sources can be bound to XAML elements to create dynamic apps.
Livid
LividOP16mo ago
Cannot bind to property 'Items' because it is read-only. comboBoxSomething.DataBindings.Add(...);
SG97
SG9716mo ago
try setting the DataSource?
Livid
LividOP16mo ago
yes does it automatically set the var as the selected item or do i manually have to do myVar = comboBox1.SelectedItem

Did you find this page helpful?