473,395 Members | 1,987 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,395 software developers and data experts.

Binding a BindingList to a DataGridView

I'm a newbie to c#, so bear with me.
I'm trying to get data into from a DataReader, put it into a
BindingList that is bound into a DataGridView. My code is:

BindingList<string[]bl = new BindingList<string[]>();
BindingSource bs = new BindingSource();
DataGridView dgv = new DataGridView();

load_list()// method that loads the list using the DataReader

bs.DataSource = bl
dgv.DataSource = bs
As I debug, I can see that the values in bl are correct (columns are
"start", "end", "duration"), but the DataGridView shows the following
columns: Length, LongLength, Rank, SyncRoot, IsReadOnly, IsFixedSize,
IsSynchronized. Of course all rows have the same value for each of
the columns.

What am I doing wrong?

Let me know if more code is needed.
Thanks in advance

Nov 20 '08 #1
0 2608

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

Similar topics

1
by: guy | last post by:
i have a datagridview and i am attempting to bind a bindingList to it. if autoGenerate columns is true the grid corectly displays all columns in the list. if AutoGenerateColumns is false i still...
1
by: Pieter | last post by:
Hi, I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the...
4
by: Stuart | last post by:
I hope someone can shed some light on an error I've been experiencing for sometime now, but can no longer continue to ignore :-( I've created a custom entity class which implements IEditableObject....
2
by: Jeff | last post by:
..NET 2.0 VS2005 I'm wondering if it possible to bind an IEnumerable list directly to a DataGridView? if it is possible then I'm wondering how it should be done? I ask because I think it must...
4
by: jehugaleahsa | last post by:
Hello: We are working on a large number of forms. The original approach was to use the built-in data designer, type-specific DataTables and form binding. However, we are running into various...
11
by: dave18 | last post by:
Hello all! I found a solution to my original question, but there's still so much I don't understand about it, I thought I'd give this forum a try. At the very least, maybe it will help someone...
1
by: Jim Balo | last post by:
Hi, When I bind a BindingList<to a DataGridView and then call RemoveAt(n) on it, I get ArgumentOutOfRange. Could someone explain why? Sample: public partial class TestForm2 : Form {...
0
by: =?Utf-8?B?Q2xhdWRl?= | last post by:
It is possible to capture the "AddingNew" event to create our own object before it is append to the BindingList (using e.NewObject = new ...) When the user press delete on a row to remove a row...
4
by: csharpula csharp | last post by:
Hello, I would like to know how can I copy from BindingList<objto some other BindingList<obj>? I tried to pass one binding list to other via constractor but this is copying it by reference and I...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.