Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple Programtic Dataset Example Doesn't work

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
sprugh
Guest





PostPosted: Fri Jan 27, 2006 10:49 pm    Post subject: Simple Programtic Dataset Example Doesn't work Reply with quote

I am currently evaluating Virtual Tree and I cannot get a basic sample using an untyped Dataset from a stored procedure to work.

I dropped the tree on a form. Added one column colEventGroupName.

Added one data binding:
DataRow(EventGroup)
->colEventGroupName(Field=group_name)

Now, at runtime, I call the stored procedure and bind like this:

AdoHelper helper = AdoHelper.CreateDefaultHelper();
DataSet notifyDS = helper.ExecuteDataset("notification_ret_all");
notifyDS.Tables[0].TableName="EventGroup";

this.m_notificationTree.DataSource = notifyDS;


But the tree only shows this:
System.Data.DataSet
->System.Data.DataViewManagerListItemTypeDescriptor


I'm assuming I'm clueless, but this is pretty basic. What am I doing wrong?

Thanks,
-Scott
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Jan 29, 2006 10:58 pm    Post subject: Reply with quote

The problem is that you haven't created any RowBindings that define how the bound data should be mapped to rows and columns. If you set your data source at design time then a default set of columns and RowBindings can be generated automatically for you - however since you are setting the data source at runtime this is not done (because there is no way to save the design time information).

You can either:

A. Define a design time dataset, set it as your data source and then auto generate the bindings and columns. This is often the quickest and easiest approach even if ultimately you want to set the data source programmatically at runtime.

B. Define the required RowBindings manually using the Virtual Tree editor. For a DataSet you need to add a DataSet binding, a DataView binding and DataRow bindings for each of the tables you want to display. For the DataRow bindings you need to set the TableName property and the Field property for each CellBinding.

See the section in the online help on "Data Binding to ADO.NET Datasets and DataViews" for more information
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
sprugh
Guest





PostPosted: Mon Jan 30, 2006 4:32 pm    Post subject: Simple Programtic Dataset Example Doesn't work Reply with quote

Ok. I get it.

I have to add a DataView binding. Then, I set the DataSource to be the DataTable not the DataSet. This seems to work.

Thanks,
-Scott
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group