DataGridView DataBinding

  • Thread starter Thread starter helpful sql
  • Start date Start date
H

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.
 
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.
 
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?
 
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.
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top