C# Pass list of tables from Interface code to Template code

Any template questions or comments or suggestions

C# Pass list of tables from Interface code to Template code

Postby dcrowell on Tue Mar 04, 2008 7:14 pm

How do you pass a list of tables from Interface code to the Template code? I am using C# for both the interface and the template code. I have seen numerous examples of this with JScript and VBScript but I want to use C#.

I tried using the ListBox.SelectedObjectCollection object but I must be missing something.
Code: Select all
System.Windows.Forms.ListBox.SelectedObjectCollection colTables;
colTables = this.lboxTables.SelectedObjectCollection;
this.zeusInput[\"tables\"] = colTables;


This is the error message:
'SelectedObjectCollection': cannot reference a type through an expression; try 'System.Windows.Forms.ListBox.SelectedObjectCollection' instead


How can I make this work?

Thanks in advance.
Dan Crowell
www.crowsol.com
Crowell Solutions, Inc.
Transforming your vision into software.
dcrowell
Lurker
 
Posts: 4
Joined: Tue Mar 04, 2008 6:47 pm
Location: Dallas, TX

Postby dnparsons on Wed Mar 05, 2008 1:59 pm

For an example template that uses C# for both the Interface and Template code, and has a multi-select ComboBox for table selection, try the TableRelation Report. It uses the MyGeneration API for the GUI, not the .NET WinForms API, but it should help.

Open MyGeneration, click the Globe icon at the top of the Template Browser pane. Navigate under the DNP.PluginExamples namespace. Right-click the TableRelation Report, and click Save.
David Neal Parsons
EntitySpaces
User avatar
dnparsons
Lieutenant General
 
Posts: 292
Joined: Sun Jan 09, 2005 2:10 pm
Location: Miami, Florida

Postby dcrowell on Wed Mar 05, 2008 4:29 pm

David, thanks. That is what I was looking for.
Dan Crowell
www.crowsol.com
Crowell Solutions, Inc.
Transforming your vision into software.
dcrowell
Lurker
 
Posts: 4
Joined: Tue Mar 04, 2008 6:47 pm
Location: Dallas, TX


Return to General Template Questions/Comments

Who is online

Users browsing this forum: No registered users and 1 guest

cron