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

Posted by Community Admin on 03-Aug-2018 15:28

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

All Replies

Posted by Community Admin on 04-Feb-2011 00:00

Hi,
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();
        alert(Array()data.UrlandTitles);
,

Posted by Community Admin on 04-Feb-2011 00:00

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

This thread is closed