예제 #1
0
        public static DataView LoadGrid(控件库.表格控件.Grid _Grid, string tbName, string Fliter, string sort, bool order)
        {
            GatherReport report = new GatherReport();
            GatherTable  tab    = report.GetReportTable(tbName);

            DevExpress.XtraEditors.Repository.RepositoryItemTextEdit text = null;
            for (int i = 0; i < _Grid.ExportBandView.Columns.Count; i++)
            {
                text = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();

                _Grid.ExportBandView.Columns[i].ColumnEdit = text;
                _Grid.ExportBandView.Columns[i].OptionsColumn.AllowEdit = true;
                tab.计算列准备(_Grid.ExportBandView.Columns[i].FieldName, _Grid, text);
            }
            DataTable tb2 = GetReportTable(tbName);

            if (order)
            {
                tb2.Columns.Add("序号", typeof(int));
            }
            DataView view = new DataView(tb2, Fliter, sort, DataViewRowState.CurrentRows);

            if (order)
            {
                SetOrder(view);
            }
            _Grid.SetDataSource(view);
            return(view);
        }
예제 #2
0
        public static void LoadGrid(控件库.表格控件.Grid _Grid, string tbName)
        {
            GatherReport report = new GatherReport();
            GatherTable  tab    = report.GetReportTable(tbName);

            DevExpress.XtraEditors.Repository.RepositoryItemTextEdit text = null;
            for (int i = 0; i < _Grid.ExportBandView.Columns.Count; i++)
            {
                text = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();

                _Grid.ExportBandView.Columns[i].ColumnEdit = text;
                _Grid.ExportBandView.Columns[i].OptionsColumn.AllowEdit = true;
                tab.计算列准备(_Grid.ExportBandView.Columns[i].FieldName, _Grid, text);
            }
            DataTable tb2 = GetReportTable(tbName);

            _Grid.SetDataSource(tb2);
        }