We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Data binding in Excel worksheet using Smart Markers in .NET

Hi.

How do I use Smart markers to bind to something other than a DataSet/DataTable?

For example, I have a Dictionary object.

var d = new Dictionary();
d["field1"] = "value1";
d["field2"] = "value1";
d["field3"] = "value1";

I apologize if this was asked 1000 times before, but I couldn't find this info anywhere.


This message was posted using Aspose.Live 2 Forum

Hi,

Well, I think you can specify your own custom class objects / anonymous types to bind them as source for smart markers if it suits your need, see the document for your reference (especially the sub-heading: “Using Anonymous Types or Custom Objects” in the document):
Smart Markers


Thank you.

I need much more detail than this document offers. This document still seems too specific to DataSet.

Let's say I have a List<> of a Dictionary:

var mylist = new List<Dictionary>();

Then what is the binding in the cell itself?

I understand that i need in my code:

designer.SetDataSource(mylist)

But what about the cell?

Is it-?

&=[mylist].SomeDictionaryKey

Or is it something like-???

&=$SomeDictionaryKey

OK, I see the solution now.

Looks like I need to encapsulate the list of dictionaries in a class and give it the proper attributes and then bind that. (I just needed to scroll down farther)

Thanks.