Home All Groups Group Topic Archive Search About

DataGridView DataBinding

Author
30 Mar 2006 5:00 PM
helpful sql
Hi all,

    I have a DataGridView control in my Windows Forms application. I am
binding it to a DataTable in another assembly. The name of the assembly is
ActivityListDALC. I want to bind my grid to
ActivityListDataSet.ActivityListDataTable in this assembly. I selected this
DataTable in the grid's Properties window and it added a component called
ScheduledCallDataTableBindingSource to my form. I can also see the column
names in my grid. But when I run the application, the grid displays no row.
Do I need to do anything in the form's load event to make sure the grid gets
populated?

Thanks in advance.

Author
30 Mar 2006 5:08 PM
Jeff
did you call the datagrid.bind() in your form load?
Author
30 Mar 2006 5:17 PM
helpful sql
Thanks. Is DataGrid different from DataGridView?
I din't see DataGrid control in my VS2005 installation. So I used
DataGridView and I don't see any Bind method in DataGridView.

Show quoteHide quote
"Jeff" <justj***@jeff.net> wrote in message
news:igUWf.20375$uX5.6779@tornado.texas.rr.com...
> did you call the datagrid.bind() in your form load?
Author
30 Mar 2006 6:49 PM
Jeff
Well, now I'm all confused...I know there is a DataGrid control...and an
ADO.NET DataView.  But I don't know what a DataGridView is.
Author
30 Mar 2006 7:03 PM
helpful sql
So you have never used DataGridView? Are you using VS2005?

Show quoteHide quote
"Jeff" <justj***@jeff.net> wrote in message
news:2LVWf.20968$uX5.2619@tornado.texas.rr.com...
> Well, now I'm all confused...I know there is a DataGrid control...and an
> ADO.NET DataView.  But I don't know what a DataGridView is.
Author
30 Mar 2006 7:18 PM
Jeff
that would explain it...  i'm trapped in 2003.NET
Author
31 Mar 2006 8:19 AM
Cor Ligthert [MVP]
Jeff,

> that would explain it...  i'm trapped in 2003.NET

To make it even more confusing, you were in my idea answering an ASPNET
datagrid.
This is the best example of the not coordinated given names in version 2003.

There are two DataGrids (still in version 2005 however not direct in the
toolbox) one for WindowsForms and one for AspNet. Luckily is this as far as
I have seen better done in version 2005.

Just as addition,

Cor
Author
30 Mar 2006 5:35 PM
helpful sql
OK, I checked how many rows there are in ScheduledCallDataTableBindingSource
component and it was empty. I had no rows. So my question is how to fill
this component with data?

Show quoteHide quote
"helpful sql" <nospam@stopspam.com> wrote in message
news:e93qhtBVGHA.4792@TK2MSFTNGP14.phx.gbl...
> Hi all,
>
>    I have a DataGridView control in my Windows Forms application. I am
> binding it to a DataTable in another assembly. The name of the assembly is
> ActivityListDALC. I want to bind my grid to
> ActivityListDataSet.ActivityListDataTable in this assembly. I selected
> this DataTable in the grid's Properties window and it added a component
> called ScheduledCallDataTableBindingSource to my form. I can also see the
> column names in my grid. But when I run the application, the grid displays
> no row. Do I need to do anything in the form's load event to make sure the
> grid gets populated?
>
> Thanks in advance.
>
Author
31 Mar 2006 8:21 AM
Cor Ligthert [MVP]
Helpful,

> OK, I checked how many rows there are in
> ScheduledCallDataTableBindingSource component and it was empty. I had no
> rows. So my question is how to fill this component with data?
>
I think that this is not possible to answer in the way you ask this.
Do you have code in your DLL to do that,
Do you have code in your DLL that can be used to start that.

If you have a look at the standard Dataset/DataTable as it is generated by
the Designer, than you are already far in the right direction.

Just my idea.

Cor
Author
2 Jun 2006 1:37 PM
Jonte
I use a xml-file and a datagridView like this to display it:
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            string filePath = "IP.xml";
            ipDataset.ReadXml(filePath);
            dataGridView1.DataSource = ipDataset;
            dataGridView1.DataMember = "ip";
        }

    }
Thats all....
Jonte

Show quoteHide quote
"helpful sql" wrote:

> Hi all,
>
>     I have a DataGridView control in my Windows Forms application. I am
> binding it to a DataTable in another assembly. The name of the assembly is
> ActivityListDALC. I want to bind my grid to
> ActivityListDataSet.ActivityListDataTable in this assembly. I selected this
> DataTable in the grid's Properties window and it added a component called
> ScheduledCallDataTableBindingSource to my form. I can also see the column
> names in my grid. But when I run the application, the grid displays no row.
> Do I need to do anything in the form's load event to make sure the grid gets
> populated?
>
> Thanks in advance.
>
>
>