All Questions
28 questions
0
votes
0
answers
163
views
Cannot click on Data Source in Properties to select new Object data sourc created
Visual Studio - C#
The problem lies when I click on the Data Source dropdown menu in Properties - bindingSource; it throws an error message.
Error message pop-up: Object reference not set to an ...
1
vote
1
answer
79
views
How to bind dataGridView with my own object array?
I have a class:
public class MarketTrade
{
public int trade_seq;
public double amount;
public double price;
public direction dir; //=enum
}
I want my ...
0
votes
0
answers
20
views
Add items in DataSource object afterwards
I am having the following scenario that gives me a headache for some time.
WinForms app that has a form for showing student details.
In the form we have the student name, the math as a subject and ...
0
votes
0
answers
747
views
C# DataBindings - two bindings to same property error
I don't know if my question is correct. What I mean is after saving the edited fields from DataBindings, after updating the database, I want to reload the data. After Reloading or calling the ...
1
vote
2
answers
367
views
Winform's combox's selected item is cached when the datasource is set to null, then back to the original list
The context is as below:
A ComboBox is binded to a BindingSource.
That BindingSource is then binded to a DataModel.
That ComboBox has a DataSource of a list of objects. Yet, this list maybe set to
...
0
votes
0
answers
31
views
BindingSource not updating underlying model
In my WinForms I have a model with its properties (just plain) and then I have a ViewModel that basically is the same as the model class except it implements INotifyPropertyChanged and calls ...
0
votes
1
answer
104
views
Display formatted string from array in DataGridView DataSource
Is there a way to display a formatted string from an array attribute while the list is bounded to the DataGridView?
I am currently using the following code:
var bindingList = new BindingList<...
2
votes
0
answers
507
views
How can I bind the Text property of a label to a property of the .SelectedValue of a ComboBox and have it update when that value changes?
I've a ComboBox that is bound to a changing list of users. That list can change based on the filter preferences of the user. The ComboBox itself displays only the users name, but I have several labels ...
8
votes
2
answers
3k
views
When setting the DataSource property of an object, when do you use a Type vs. an instance?
Question
What is the difference between setting a [...].DataSource to an instance of an object vs. the type of a class? I have seen both methods in use in our codebase, and I'm trying to wrap my ...
0
votes
0
answers
391
views
How to use BindingSource, datagridView and navigating buttons together
is there any chance to make the navigating buttons operate on the whole database while the datagrid would show only the filtered results? I mean, I have a datagridview and some textboxes ...
5
votes
3
answers
6k
views
Data sources empty on ReportViewer
I'm trying to link up my report viewer to the data sources, however the dialog box is empty -
I have a file called dsReports.xsd which has data sets that work when I preview data from there.
Anyone ...
4
votes
2
answers
4k
views
Combobox binded to a list. Adding new item to the list does not affect combobox
There is following code:
public partial class Form1 : Form
{
private List<string> names = new List<string> { "aa", "bb", "cc" };
public Form1()
{
InitializeComponent()...
1
vote
1
answer
1k
views
Binding a translated enum to a combobox in a Windows Forms based application
Due to differences between naming and enum I cannot simply bind. Thought of the following:
Use an array of translated values as datasource;
Databinding the property with format/parse events to convert ...
0
votes
1
answer
818
views
Updating of BindingSource in WinForms
During my attempts to use DataBinding in Winforms I've encountered with a problem. It looks like after updating of DataSource DataGridView doesn't refresh the data. Can't understand where is a problem....
0
votes
1
answer
86
views
Is the verbose version better or verboten?
I've been populating a combobox this way (getRoundingMethodVals() returns a List<String>):
comboBoxRounding.DataSource = RateSetupData.getRoundingMethodVals();
...but I saw on a StackOverflow ...