More in this section

Forums / General Discussions / How to read a c# array object in Widget designer c# file

How to read a c# array object in Widget designer c# file

2 posts, 0 answered
  1. Moiz Ahmed
    Moiz Ahmed avatar
    15 posts
    31 Dec 2010
    04 Feb 2011
    Link to this post
    I tried to read a C# object array in the designer js file I get the object but when I try to iterate it it say undefined.
    This is my code
    c# property
    private object[] _UrlandTitles = { "Hello1", "Hello2", "Hello3" };
            public object[] UrlandTitles
                get { return _UrlandTitles; }
                set { _UrlandTitles = value; }
    Designer js refreshUI
    refreshUI: function ()
            var data = this._propertyEditor.get_control();
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    04 Feb 2011
    Link to this post
    Hi Moiz,

    In this is the code you use, you can replace the object with string array, otherwise you have to mark the property you have with an attribute [DataMember] - when applied to the member of a type, specifies that the member is part of a data contract and is serializable by the DataContractSerializer.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered