Ejemplo n.º 1
0
        private void grdDocuments_InitialiseData(TFrmPetraReportingUtils APetraUtilsObject)
        {
            // Get list of documents
            FDocumentTypeTable = (PmDocumentTypeTable)TDataCache.TMPersonnel.GetCacheablePersonnelTable(
                TCacheablePersonTablesEnum.DocumentTypeList);

            grdDocuments.Columns.Clear();

            grdDocuments.AddTextColumn("Document Type", FDocumentTypeTable.Columns[PmDocumentTypeTable.GetDocCodeDBName()]);
            grdDocuments.AddTextColumn("Description", FDocumentTypeTable.Columns[PmDocumentTypeTable.GetDescriptionDBName()]);

            FDocumentTypeTable.DefaultView.AllowNew    = false;
            FDocumentTypeTable.DefaultView.AllowDelete = false;

            grdDocuments.DataSource = new DevAge.ComponentModel.BoundDataView(FDocumentTypeTable.DefaultView);
            grdDocuments.AutoSizeCells();
            grdDocuments.Selection.EnableMultiSelection = true;

            UseDatesChanged(null, null);
        }
        private void clbDocuments_InitialiseData()
        {
            string CheckedMember = "CHECKED";

            // Get list of documents
            FDocumentTypeTable = (PmDocumentTypeTable)TDataCache.TMPersonnel.GetCacheablePersonnelTable(
                TCacheablePersonTablesEnum.DocumentTypeList);

            DataColumn FirstColumn = new DataColumn(CheckedMember, typeof(bool));

            FirstColumn.DefaultValue = false;
            FDocumentTypeTable.Columns.Add(FirstColumn);

            clbDocuments.Columns.Clear();
            clbDocuments.AddCheckBoxColumn("", FDocumentTypeTable.Columns[CheckedMember], 17, false);
            clbDocuments.AddTextColumn("Document Type", FDocumentTypeTable.Columns[PmDocumentTypeTable.GetDocCodeDBName()]);
            clbDocuments.AddTextColumn("Description", FDocumentTypeTable.Columns[PmDocumentTypeTable.GetDescriptionDBName()]);

            clbDocuments.DataBindGrid(FDocumentTypeTable, PmDocumentTypeTable.GetDocCodeDBName(), CheckedMember,
                                      PmDocumentTypeTable.GetDocCodeDBName(), false, true, false);
            clbDocuments.AutoResizeGrid();

            UseDatesChanged(null, null);
        }