473,385 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGridView Almost Working....

I'm trying to bind a DataGridView to a BindingList that is a member of
the main form. It worked once, then stopped. Now it does not display
data when the list is clearly populated. I just get an empty grid.
There seems to be several ways to bind the grid, none of which seem to work:

1) I can set the DataSource to MainFormBingingSource and DataMember to
dataList,

-or-

2) I can set DataSource to MainFormBindingSource, then under it appears
an expansion where I can directly select dataList.

(MainForm is the form and dataList is the BindingList).

It works like a champ if I set DataSource = dataList in the form
constructor, but then I have to programmatically format it, uhggg!

So, what am I doing wrong? Why no data? Is there a 'Refresh Grid Data'
function?
Jun 27 '07 #1
1 1377

PS. To make the dataList visible as a data source, I did have to
Refractor -Encasulate Field it and promote it to a property (what a
cool feature!). Was that cheating and there is supposed to be another
way to make it visible...??? (As a simple member-variable, the list
could not be set as a DataSource or DataMember).
bern11 wrote:
I'm trying to bind a DataGridView to a BindingList that is a member of
the main form. It worked once, then stopped. Now it does not display
data when the list is clearly populated. I just get an empty grid.
There seems to be several ways to bind the grid, none of which seem to
work:

1) I can set the DataSource to MainFormBingingSource and DataMember to
dataList,

-or-

2) I can set DataSource to MainFormBindingSource, then under it appears
an expansion where I can directly select dataList.

(MainForm is the form and dataList is the BindingList).

It works like a champ if I set DataSource = dataList in the form
constructor, but then I have to programmatically format it, uhggg!

So, what am I doing wrong? Why no data? Is there a 'Refresh Grid Data'
function?
Jun 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should...
3
by: steve | last post by:
Hi All How can I get the datagridview to redraw after changing the rowtemplate.height at runtime ( it is databound to a datatable) I have tried datagridview1.refresh etc to no avail (The row...
11
by: Kevin | last post by:
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a...
8
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the...
7
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so...
0
by: Paul | last post by:
I'm creating a UserControl that uses a DataGridView in virtual mode. It was working fine other than a few bugs. After I fixed those few bugs, I broke it. I have a cache of 50 records. The...
6
by: Bill Nguyen | last post by:
I tried almost everything ..Rows.clear() ..rowcount = 0 and the rows in a datagridview still not cleared I populated the Datagridview manually using Row.Add Any help is greatly appreciated ...
4
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
how do you insert a new row to a databound datagridview? It won't allow this action.
7
by: Mike | last post by:
i have a small difficulties with BindingSource and dataGridView bind db has properly opened and bind doesn't works. Unfortunately I didn't find any good example how to connect MS Access with...
3
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm trying to add a datagridview control to a Windows Form to display read-only information in visual basic 2005. My understanding is that datareader will be faster for this purpose. I have the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.