This is a migrated thread and some comments may be shown as answers.

Binding to object by index

2 Answers 214 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 17 Nov 2011, 08:31 PM
Hello!
I have some object which binded to report item. This object contains property with IList type.
I need to bind to some of object from this list by index in template. For example, "=CustomFieldValues[5].Date".
Is there possible in Telerik Reporting templates? And which syntax I should use?
Thank you!

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 18 Nov 2011, 01:26 PM
Hello Sergey,

In order to handle array values in an expression, our suggestion is to utilize an user function. Check out the following sample:

public static string GetItemValue(string[] values, int index)
{
    return values[index];
}

Kind regards,
Peter
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Sergey
Top achievements
Rank 1
answered on 18 Nov 2011, 01:30 PM
Thank you Peter.It works fine.
Tags
General Discussions
Asked by
Sergey
Top achievements
Rank 1
Answers by
Peter
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or