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

LoadContentFile/LoadXml Method

3 Answers 49 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Udi
Top achievements
Rank 1
Udi asked on 10 Oct 2010, 03:56 PM
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

3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 14 Oct 2010, 01:55 PM
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
0
Udi
Top achievements
Rank 1
answered on 14 Oct 2010, 03:03 PM
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
0
Genady Sergeev
Telerik team
answered on 20 Oct 2010, 09:43 AM
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
Tags
ListBox
Asked by
Udi
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Udi
Top achievements
Rank 1
Share this question
or