LoadContentFile/LoadXml Method

4 posts, 0 answers
  1. Oren
    Oren avatar
    36 posts
    Member since:
    Sep 2010

    Posted 10 Oct 2010 Link to this post

    Hello,

    Why when i use the "LoadContentFile" method ot the "LoadXml" method a new instance of RadListBox has been created.
    If i use these methods, first it goes into the constructor of the listbox.

    Below is my class inherite from RadListBox

    public class MyRadListBox: RadListBox
        {
            public MyRadListBox()
            {
               InitControl();
            
               .
               .
               .
        }

    If i create an instance of MyListBox and call to LoadContentFile("LB.xml) then first it to the MyRadListBox Ctor.

    MyListBox myListBox=new MyListBox();
    myListBox.LoadContentFile("LB.xml");

    Is there any option to avoid this? it pretty annoying and cause to bugs.

    Regards,
    Oren
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 14 Oct 2010 Link to this post

    Hello Oren,

    I am not sure that I understand what is the exact issue that you face, could you please clarify? As far as I can see you inherit RadListBox and call the LoadContentFile method. This should populate the RadListBox instance with data. 

    Sincerely yours,
    Genady Sergeev
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Oren
    Oren avatar
    36 posts
    Member since:
    Sep 2010

    Posted 14 Oct 2010 Link to this post

    Hello Genady,

    OK i'll try to explain it better,

    In my case, if i call to the LoadContentFile method,
    First it gets into the constructor(public MyRadListBox) and then load the content (the data).
    I don't understand why it should first gets into the constructor.

    Thank you,
    Oren
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 20 Oct 2010 Link to this post

    Hi Oren,

    When I tried this on a sample project I noticed that the constructor is called only once, as expected. Calling to the LoadContentFile didn't invoke the constructor. Could you please open a support ticket and attach there a sample project that reproduces the fault so that we can take a look on what is going wrong. Thank you.

    Kind regards,
    Genady Sergeev
    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
Back to Top