当前位置: 首页>>代码示例>>C#>>正文


C# GridControl.ForceInitialize方法代码示例

本文整理汇总了C#中GridControl.ForceInitialize方法的典型用法代码示例。如果您正苦于以下问题:C# GridControl.ForceInitialize方法的具体用法?C# GridControl.ForceInitialize怎么用?C# GridControl.ForceInitialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridControl的用法示例。


在下文中一共展示了GridControl.ForceInitialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GridSetOption

        public static void GridSetOption(GridControl dxGrid, XElement xe, DataTable dt, IDbConnection con, DataList dataList)
        {
            string sOption = xe.zAttribValue("Option");
            XtraGridOption option = new XtraGridOption(sOption);
            dxGrid.ForceInitialize();

            //GridSetNavigatorOption(dxGrid, option);
            XtraGridTools.SetNavigatorOption(dxGrid, option);

            GridSetViewOption((GridView)dxGrid.MainView, xe, dt, con, dataList, option);
            dxGrid.Leave += new EventHandler(GridControl_Leave);
        }
开发者ID:labeuze,项目名称:source,代码行数:12,代码来源:cGrid.cs

示例2: CreateControlsCore

 protected override object CreateControlsCore() {
     if (grid == null) {
         grid = CreateGridControl();
         ((System.ComponentModel.ISupportInitialize)(grid)).BeginInit();
         try {
             grid.MinimumSize = new Size(100, 75);
             grid.Dock = DockStyle.Fill;
             grid.AllowDrop = true;
             SubscribeToGridEvents();
             grid.Height = 100;
             grid.TabStop = true;
             grid.MainView = (BaseView)CreateGridView();
             SetupGridView();
             SetGridViewOptions();
             ApplyModel();
             SetTag();
         } finally {
             ((System.ComponentModel.ISupportInitialize)(grid)).EndInit();
             grid.ForceInitialize();
         }
         OnPrintableChanged();
     }
     return grid;
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:24,代码来源:GridListEditorBase.cs

示例3: GridSetDataSource

        private static void GridSetDataSource(GridControl grid, DataTable dt, XElement xe, IDbConnection con, DataList dataList, XtraGridOption option)
        {
            //if (gbTrace) cTrace.StartNestedLevel("cGrid_GridSetDataSource");

            //if (gbTrace) cTrace.StartNestedLevel("EndEvent");
            if (grid.Tag is FormGridEvent)
                ((FormGridEvent)grid.Tag).End();
            //if (gbTrace) cTrace.StopNestedLevel("EndEvent");

            ((GridView)grid.MainView).CollapseAllDetails();
            GridClearDataSource(grid);

            //if (option.MasterViewMode) GridCreateDetailViews(grid, dt);
            if (option.MasterViewMode) XtraGridTools.GridCreateDetailViews(grid, dt);

            //if (gbTrace) cTrace.StartNestedLevel("SetDataSource");
            grid.DataSource = dt;
            grid.ForceInitialize();
            //if (gbTrace) cTrace.StopNestedLevel("SetDataSource");

            //GridSetNavigatorOption(grid, option);
            XtraGridTools.SetNavigatorOption(grid, option);

            GridSetViewOption((GridView)grid.MainView, xe, dt, con, dataList, option);

            grid.Leave += new EventHandler(GridControl_Leave);

            if (xe != null && option.MasterViewMode)
            {
                IEnumerator<XElement> xeDetailEnum = xe.Elements("def").GetEnumerator();
                foreach (DataRelation r in dt.ChildRelations)
                {
                    if (!xeDetailEnum.MoveNext()) break;
                    XElement xeDetail = xeDetailEnum.Current;
                    string sRelation = r.RelationName;
                    if (sRelation == null) break;
                    GridView view = (GridView)grid.LevelDefaults[sRelation];
                    GridSetViewOption(view, xeDetail, r.ChildTable, con, dataList);
                }
            }

            //if (option.ExpandAllMasterRows) GridExpandAllMasterRows(grid);
            if (option.ExpandAllMasterRows) XtraGridTools.GridExpandAllMasterRows((GridView)grid.MainView);

            grid.Tag = new FormGridEvent(grid, xe);

            //if (gbTrace) cTrace.StopNestedLevel("cGrid_GridSetDataSource");
        }
开发者ID:labeuze,项目名称:source,代码行数:48,代码来源:cGrid.cs


注:本文中的GridControl.ForceInitialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。