Page 1 of 1

How to access a Dictionary<string, string> property easy

Posted: Wed Sep 15, 2010 2:41 am
by vorauler
Hello

We have following object:
class Sample
{
public string Tag { get; set; }
public string Description { get; set; }
public Dictionary TextElemente { get; set; }
}

In the report we can access a element of the Dictionary property via
{((System.Collections.Generic.Dictionary)Sample.TextElemente)["B"]}.

Is it possible to access the property without the cast like {Sample.TextElemente["B"]}

Ralf

How to access a Dictionary<string, string> property easy

Posted: Wed Sep 15, 2010 7:27 am
by Alex K.
Hello,

Please add in your report

using System.Collections.Generic;

Thank you.

How to access a Dictionary<string, string> property easy

Posted: Wed Sep 15, 2010 7:36 am
by vorauler
Hello

If I add using System.Collections.Generic and remove the cast I get the error:
Cannot apply indexing with [] to an expression of type object

Ralf

How to access a Dictionary<string, string> property easy

Posted: Fri Sep 17, 2010 6:41 am
by Alex K.
Hello,

Please send us a sample report with data on support@stimulsoft.com.

Thank you.