【问题标题】:About DevExpress UserControl关于 DevExpress 用户控件
【发布时间】:2011-05-12 09:59:13
【问题描述】:

我在 vs2010 专业版中创建了一个用户控件。用户控件来自 DevExpress。 我使用了 usercontrol 的 load() 事件。我为我的用户控制应用程序使用了 xml 文件。在用户控件中,我添加了 DevExpress xtraTreeList 控件并使用我的 xml 文件填充了 xtraTreeList 的节点。我的 xml 文件存在于我的应用程序目录路径中 - E:\MsgBlasterApplicationtemp\MsgBlasterApplication\bin\Debug\Database 。 当我在表单中拖放用户控件时,它会给我错误。错误如下--

Failed to creste component ' TreeListUserControl'. The error message follows: 'System.IO.DirectoryNotFoundException:Could not find part of path.

【问题讨论】:

    标签: c# winforms devexpress


    【解决方案1】:

    这是默认行为,如果您在标准 UserControl 上使用标准 GridView,您将重现它。当 UserControl 位于表单上时,其上的所有控件都像应用程序运行一样工作:(。这是适合您的解决方案:

        private void XtraUserControl1_Load(object sender, EventArgs e) {
            if(!DesignMode) {
                // your code to populate the treeList with data
             }
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 2015-10-04
      • 2011-09-26
      • 1970-01-01
      相关资源
      最近更新 更多