Ejemplo n.º 1
0
        private void InitGridDataView()
        {
            DataGridViewButtonColumn BTSingle = new DataGridViewButtonColumn();

            BTSingle.HeaderText = "개별실행";
            BTSingle.Name       = "Single Execute";
            BTSingle.Text       = "실행";
            BTSingle.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn BTExit = new DataGridViewButtonColumn();

            BTExit.HeaderText = "개별종료";
            BTExit.Name       = "Exit Program";
            BTExit.Text       = "종료";
            BTExit.UseColumnTextForButtonValue = true;

            IDDataTable.Columns.Add("ID");
            IDDataTable.Columns.Add("PW");
            IDDataTable.Columns.Add("STATE");
            IDDataTable.Columns["STATE"].ReadOnly = true;
            IDDataTable.Columns.Add("GROUP", typeof(int));
            FC.LoadData(ref IDDatas);
            InitRow();
            this.dataGridView_Info.DataSource = this.IDDataTable;
            this.dataGridView_Info.Columns["GROUP"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;

            dataGridView_Info.Columns.Add(BTSingle);
            dataGridView_Info.Columns.Add(BTExit);

            dataGridView_Info.CellClick += new DataGridViewCellEventHandler(SingleExecute);
            dataGridView_Info.CellClick += new DataGridViewCellEventHandler(SingleKillProcess);
        }
Ejemplo n.º 2
0
        private void InitCommand_Grid()
        {
            try
            {
                CommandDataTable.Columns.Add("명령어");

                DataGridViewButtonColumn BTSingle = new DataGridViewButtonColumn();
                BTSingle.HeaderText = "";
                BTSingle.Name       = "수행";
                BTSingle.Text       = "명령수행";
                BTSingle.UseColumnTextForButtonValue = true;

                DataGridViewComboBoxColumn cCell = new DataGridViewComboBoxColumn();
                cCell.HeaderText   = "ID";
                cCell.Name         = "ID";
                cCell.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton;

                foreach (string strID in this.IDDatas.getDataTable().Keys)
                {
                    cCell.Items.Add(strID);
                }

                if (FC.LoadData(ref commanddatas) == true)
                {
                    foreach (CommandDatas data in commanddatas)
                    {
                        CommandDataTable.Rows.Add(data.strCommand);
                    }
                }
                else
                {
                    commanddatas = new List <CommandDatas>();
                }

                this.dataGridView_Command.DataSource = this.CommandDataTable;
                dataGridView_Command.Columns.Add(BTSingle);
                dataGridView_Command.CellClick += new DataGridViewCellEventHandler(CommandInput);
                dataGridView_Command.Columns.Add(cCell);

                this.dataGridView_Command.Columns["명령어"].Width = (int)(this.dataGridView_Command.Width * 0.6);
                this.dataGridView_Command.Columns["수행"].Width  = (int)(this.dataGridView_Command.Width * 0.15);
                this.dataGridView_Command.Columns["ID"].Width  = (int)(this.dataGridView_Command.Width * 0.15);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString());
            }
        }