C
C#15mo ago
Livid

✅ winform databinding

how to i add a integer to a textbox.text
10 Replies
Bailey
Bailey15mo ago
Hi, the only way is to convert it to a string.
SG97
SG9715mo ago
is databinding actually what you want here
Livid
LividOP15mo 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
SG9715mo ago
look into BindingSource
Livid
LividOP15mo ago
why does datasource no require a object to be a string while databinds in this case does
SG97
SG9715mo ago
I've no idea what you mean, can you post your current code
Bailey
Bailey15mo 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
LividOP15mo ago
Cannot bind to property 'Items' because it is read-only. comboBoxSomething.DataBindings.Add(...);
SG97
SG9715mo ago
try setting the DataSource?
Livid
LividOP15mo ago
yes does it automatically set the var as the selected item or do i manually have to do myVar = comboBox1.SelectedItem
Want results from more Discord servers?
Add your server