コード例 #1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            // Create utility objects
            YaoDurant.Data.UtilData utilData = new UtilData();
            YaoDurant.GUI.UtilGUI   utilGUI  = new UtilGUI();

            //  Set references to data objects.
            dsetTimeTracker = utilData.GetProjectsDataSet();
            dtabProjects    = dsetTimeTracker.Tables["Projects"];
            dtabTasks       = dsetTimeTracker.Tables["Tasks"];

            //  Make the Project table the DataSource.
            //  Make the strIdent field of the currently
            //     select row the Text property of the DataGrid
            //     control.
            dgridDisplay.DataSource = dtabProjects;
            dgridDisplay.DataBindings.Clear();
            dgridDisplay.DataBindings.Add(
                "Text",
                dgridDisplay.DataSource,
                "strIdent");

            //  Use a utility routine to style the
            //     layout of Projects in the DataGrid.
            UtilGUI.AddCustomDataTableStyle(dgridDisplay,
                                            "Projects");

            //  Initialize the ContextMenu
            InitContextMenu();
        }