Reputation: 2832
I've created one usercontrol in vs2010 professional . The usercontrol is from DevExpress. I've used usercontrol's load() event. And i used xml file for my usercontrol application. In usercontrol i've added DevExpress xtraTreeList control & i populated nodes of xtraTreeList by using my xml file. My xml file is present in my applications directory path means- E:\MsgBlasterApplicationtemp\MsgBlasterApplication\bin\Debug\Database . When i'm drag & drop my usercontrol in my form then it gives me error. The error is as follows--
Failed to creste component ' TreeListUserControl'. The error message follows:
'System.IO.DirectoryNotFoundException:Could not find part of path.
Upvotes: 0
Views: 2477
Reputation: 11376
This is the default behavior and you will reproduce it if you use the standard GridView on the standard UserControl. When the UserControl is positioned on a form, all controls on it work as if the application runs :(. Here is the solution which should work fine for you:
private void XtraUserControl1_Load(object sender, EventArgs e) {
if(!DesignMode) {
// your code to populate the treeList with data
}
}
Upvotes: 2