I have a an issue in my windows application project, a very small one I'm afraid which for some reason I can't get a hang of the solution.
I want to display data in a Data grid programmatically, but it returns only the rows based on the number of records fetched from the database WITHOUT Data in it. Below is my code
private void BindDataToGrid()
{
var teller = new TellerService().GetByUsername(username);
var transactions = new PocTransactionService().GetByTellerId(teller.TellerId);
BindingList<PocTransaction> trans = new BindingList<PocTransaction>(transactions);
var source = new BindingSource(trans, null);
dgvTransactions.DataSource = source;
}
Not that the variable transactions gets populated in the code, but for some reason, it's not displaying on grid. It's really driving me nuts. I trust one of you here to show me the way out.
var source = new BindingSource(trans);? - Gabriel GMBindingSourcedoesn't take less than two arguments Gabriel. But thanks for your response. - KaceyDataMember) default value is"". Maybe that will help.. When working withBindingSource, I usually use the default constructor, then set theDataSource. - Gabriel GMBindingListANDBindingSource.. try binding the BindingList directly :dgvTransactions.DataSource = trans;. - Gabriel GM