Example #1
0
        public void Form1_Load(object sender, EventArgs e)
        {
            DataGridViewTextBoxColumn col3 = new DataGridViewTextBoxColumn();

            col3.ReadOnly = true;
            col3.Name     = "ProductName";
            dataGridView1.Columns.Add(col3);
            // DataGridViewCheckBoxColumn column0 =
            //   new DataGridViewCheckBoxColumn();
            DataGridViewDisableButtonColumn column1 =
                new DataGridViewDisableButtonColumn();

            //column0.Name = "CheckBoxes";
            column1.Name = "Buttons";
            // dataGridView1.Columns.Add(column0);
            dataGridView1.Columns.Add(column1);
            dataGridView1.RowCount = 8;
            //    dataGridView1.AutoSize = true;
            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.ColumnHeadersDefaultCellStyle.Alignment =
                DataGridViewContentAlignment.MiddleCenter;



            //dataGridView1.CellValueChanged +=
            //    new DataGridViewCellEventHandler(dataGridView1_CellValueChanged);
            //dataGridView1.CurrentCellDirtyStateChanged +=
            //    new EventHandler(dataGridView1_CurrentCellDirtyStateChanged);
            dataGridView1.CellClick +=
                new DataGridViewCellEventHandler(dataGridView1_CellClick);

            this.Controls.Add(dataGridView1);
            // Set the text for each button.
            for (int i = 0; i < dataGridView1.RowCount; i++)
            {
                dataGridView1.Rows[i].Cells["Buttons"].Value =
                    "Button " + i.ToString();
                //dataGridView1.Rows[i].Cells["CheckBoxes"].Value = true;
                dataGridView1.Rows[i].Cells["ProductName"].Value = i.ToString();
            }
        }
Example #2
0
        private void InitialiseGrid()
        {
            DataGridViewTextBoxColumn col0 = new DataGridViewTextBoxColumn();

            col0.ReadOnly   = true;
            col0.HeaderText = "Name of the Student";
            col0.Name       = "UserName";
            dataGridView1.Columns.Add(col0);
            this.dataGridView1.Columns[0].Width = 100;

            DataGridViewTextBoxColumn col01 = new DataGridViewTextBoxColumn();

            col01.ReadOnly   = true;
            col01.HeaderText = "Date Taken";
            col01.Name       = "DateTaken";
            dataGridView1.Columns.Add(col01);
            this.dataGridView1.Columns[01].Width = 100;

            DataGridViewTextBoxColumn col1 = new DataGridViewTextBoxColumn();

            col1.ReadOnly   = true;
            col1.HeaderText = "Test Score";
            col1.Name       = "TestMark";
            dataGridView1.Columns.Add(col1);
            this.dataGridView1.Columns[1].Width = 60;

            DataGridViewTextBoxColumn buttonColumn =
                new DataGridViewTextBoxColumn();

            buttonColumn.ReadOnly   = true;
            buttonColumn.HeaderText = "Test Status";
            buttonColumn.Name       = "TestSatus";
            // buttonColumn.Text = "TestStatus";

            dataGridView1.Columns.Add(buttonColumn);
            this.dataGridView1.Columns[2].Width = 60;

            DataGridViewDisableButtonColumn buttonColumn1 =
                new DataGridViewDisableButtonColumn();

            buttonColumn1.ReadOnly   = true;
            buttonColumn1.HeaderText = "Action";
            buttonColumn1.Name       = "Action";
            buttonColumn1.Tag        = "Proceed";
            buttonColumn1.DefaultCellStyle.BackColor = Color.Red;
            // buttonColumn1.Text = "Generate";
            //buttonColumn1.UseColumnTextForButtonValue = false;

            dataGridView1.Columns.Add(buttonColumn1);


            this.dataGridView1.Columns[3].Width = 60;


            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.ColumnHeadersDefaultCellStyle.Alignment =
                DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Update();// = buttonColumn3;


            dataGridView1.RowCount = objQuestionManagement.objResultList.Count();

            for (int i = 0; i < objQuestionManagement.objResultList.Count; i++)
            {
                dataGridView1.Rows[i].Cells["UserName"].Value  = objQuestionManagement.objResultList[i].UserName;
                dataGridView1.Rows[i].Cells["TestMark"].Value  = objQuestionManagement.objResultList[i].TestMark;
                dataGridView1.Rows[i].Cells["TestSatus"].Value = objQuestionManagement.objResultList[i].TestSatus;
                dataGridView1.Rows[i].Cells["DateTaken"].Value = objQuestionManagement.objResultList[i].DateTaken;
                dataGridView1.Rows[i].Cells["Action"].Value    = "Summary";
            }

            dataGridView1.CellClick +=
                new DataGridViewCellEventHandler(dataGridView1_CellClick);
        }
Example #3
0
        public QuestionPaperDisplay()
        {
            InitializeComponent();


            DataGridViewTextBoxColumn col0 = new DataGridViewTextBoxColumn();

            col0.ReadOnly   = true;
            col0.HeaderText = "Exam Name";
            col0.Name       = "ExamName";
            dataGridView1.Columns.Add(col0);
            //this.dataGridView1.Columns[0].Width = 175;

            DataGridViewTextBoxColumn col1 = new DataGridViewTextBoxColumn();

            col1.ReadOnly   = true;
            col1.HeaderText = "No of Questions";
            col1.Name       = "Subject";
            dataGridView1.Columns.Add(col1);
            this.dataGridView1.Columns[0].Width = 200;

            DataGridViewDisableButtonColumn buttonColumn =
                new DataGridViewDisableButtonColumn();

            buttonColumn.HeaderText             = "Question";
            buttonColumn.Name                   = "Question";
            buttonColumn.Text                   = "Generate";
            buttonColumn.Tag                    = "Question";
            this.dataGridView1.Columns[1].Width = 60;
            dataGridView1.Columns.Add(buttonColumn);


            DataGridViewDisableButtonColumn buttonColumn1 =
                new DataGridViewDisableButtonColumn();

            buttonColumn1.HeaderText = "Q and A";
            buttonColumn1.Name       = "QandA";
            buttonColumn1.Tag        = "QandA";
            buttonColumn1.Text       = "Generate";
            //buttonColumn1.UseColumnTextForButtonValue = false;
            this.dataGridView1.Columns[2].Width = 60;
            dataGridView1.Columns.Add(buttonColumn1);


            DataGridViewDisableButtonColumn buttonColumn2 =
                new DataGridViewDisableButtonColumn();

            buttonColumn2.HeaderText = "Answer";
            buttonColumn2.Name       = "Answer";
            buttonColumn2.Tag        = "Answer";
            buttonColumn2.Text       = "Generate";
            //buttonColumn2.UseColumnTextForButtonValue = false;
            dataGridView1.Columns.Add(buttonColumn2);
            this.dataGridView1.Columns[3].Width = 60;

            DataGridViewDisableButtonColumn buttonColumn4 =
                new DataGridViewDisableButtonColumn();

            buttonColumn4.HeaderText = "OMR";
            buttonColumn4.Name       = "OMR";
            buttonColumn4.Tag        = "OMR";
            buttonColumn4.Text       = "Generate";
            //buttonColumn2.UseColumnTextForButtonValue = false;
            dataGridView1.Columns.Add(buttonColumn4);
            this.dataGridView1.Columns[4].Width = 60;

            DataGridViewDisableButtonColumn buttonColumn3 =
                new DataGridViewDisableButtonColumn();

            buttonColumn3.HeaderText = "Delete";
            buttonColumn3.Name       = "Delete";
            buttonColumn3.Tag        = "Delete";
            buttonColumn3.Text       = "Delete";
            //buttonColumn2.UseColumnTextForButtonValue = false;
            dataGridView1.Columns.Add(buttonColumn3);
            this.dataGridView1.Columns[5].Width = 60;
            this.dataGridView1.Columns[6].Width = 60;

            //  dataGridView1.AutoSize = true;
            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.ColumnHeadersDefaultCellStyle.Alignment =
                DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Update();// = buttonColumn3;



            dataGridView1.CellClick +=
                new DataGridViewCellEventHandler(dataGridView1_CellClick);
            dataGridView1.Dock            = DockStyle.Fill;
            dataGridView1.BackgroundColor = Color.LightGray;
            dataGridView1.BorderStyle     = BorderStyle.Fixed3D;

            // Set RowHeadersDefaultCellStyle.SelectionBackColor so that its default
            // value won't override DataGridView.DefaultCellStyle.SelectionBackColor.
            dataGridView1.RowHeadersDefaultCellStyle.SelectionBackColor = Color.Empty;

            // Set the selection background color for all the cells.
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.White;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.Black;
            //Set RowHeadersDefaultCellStyle.SelectionBackColor so that its default
            // value won't override DataGridView.DefaultCellStyle.SelectionBackColor.
            dataGridView1.RowHeadersDefaultCellStyle.SelectionBackColor = Color.Empty;

            // Set the background color for all rows and for alternating rows.
            // The value for alternating rows overrides the value for all rows.
            dataGridView1.RowsDefaultCellStyle.BackColor            = Color.LightBlue;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.MediumAquamarine;

            LoadTextData();
        }
        public PurchaseManagement()
        {
            InitializeComponent();
            #region DataGrid Definition
            //   getParent = ObjectXMLSerializer<QuestionsData>.Load(XML_QUESTION_NAME);
            label1.Text = "System IP : " + EntropyGenerator.GetIPForMachine();
            this.Size   = new System.Drawing.Size(Int32.Parse(KnowledgeMatrix.Properties.Settings.Default.PanelWidth), Int32.Parse(KnowledgeMatrix.Properties.Settings.Default.PanelHeight));
            if (File.Exists(Utility.XML_QUESTION_NAME))
            {
                result = ObjectXMLSerializer <QuestionsData> .Load(Utility.XML_QUESTION_NAME);
            }
            else
            {
                MessageBox.Show("Kindly validate the license. Contact System Administrator");
                return;
            }
            DataGridViewTextBoxColumn col0 = new DataGridViewTextBoxColumn();
            col0.ReadOnly   = true;
            col0.HeaderText = "Product Name";
            col0.Name       = "ProductName";
            dataGridView1.Columns.Add(col0);
            this.dataGridView1.Columns[0].Width = 445;

            DataGridViewDisableButtonColumn buttonColumn =
                new DataGridViewDisableButtonColumn();
            buttonColumn.HeaderText = "Km-Knowledge Tutor";
            buttonColumn.Name       = "eTutor";
            buttonColumn.Text       = "Purchase";
            buttonColumn.Tag        = "eTutor";
            dataGridView1.Columns.Add(buttonColumn);


            DataGridViewDisableButtonColumn buttonColumn1 =
                new DataGridViewDisableButtonColumn();
            buttonColumn1.HeaderText = "Km- Knowledge Base";
            buttonColumn1.Name       = "QuestionBank";
            buttonColumn1.Tag        = "QuestionBank";
            buttonColumn1.Text       = "Purchase";
            //buttonColumn1.UseColumnTextForButtonValue = false;

            dataGridView1.Columns.Add(buttonColumn1);


            DataGridViewDisableButtonColumn buttonColumn2 =
                new DataGridViewDisableButtonColumn();
            buttonColumn2.HeaderText = "Km-Knowledge Assessment";
            buttonColumn2.Name       = "QuestionPaper";
            buttonColumn2.Tag        = "QuestionBankGeneration";
            buttonColumn2.Text       = "Purchase";
            //buttonColumn2.UseColumnTextForButtonValue = false;
            dataGridView1.Columns.Add(buttonColumn2);
            this.dataGridView1.Columns[3].Width = 100;

            DataGridViewDisableButtonColumn buttonColumn3 =
                new DataGridViewDisableButtonColumn();
            buttonColumn3.HeaderText = "Km-Knowledge Evaluator";
            buttonColumn3.Name       = "MockTest";
            buttonColumn3.Tag        = "MockTest";
            buttonColumn3.Text       = "Purchase";
            // buttonColumn3.UseColumnTextForButtonValue = false;

            dataGridView1.Columns.Add(buttonColumn3);


            // dataGridView1.Columns.Add(column0);

            //  dataGridView1.RowCount = 2;
            // dataGridView1.AutoSize = true;
            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.ColumnHeadersDefaultCellStyle.Alignment =
                DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Update();// = buttonColumn3;
            #endregion
            dataGridView1.CellClick +=
                new DataGridViewCellEventHandler(dataGridView1_CellClick);

            //  dataGridView1.Dock = DockStyle.Fill;
            dataGridView1.BackgroundColor = Color.LightGray;
            dataGridView1.BorderStyle     = BorderStyle.Fixed3D;

            // Set RowHeadersDefaultCellStyle.SelectionBackColor so that its default
            // value won't override DataGridView.DefaultCellStyle.SelectionBackColor.
            dataGridView1.RowHeadersDefaultCellStyle.SelectionBackColor = Color.Empty;

            // Set the selection background color for all the cells.
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.White;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.Black;
            //Set RowHeadersDefaultCellStyle.SelectionBackColor so that its default
            // value won't override DataGridView.DefaultCellStyle.SelectionBackColor.
            dataGridView1.RowHeadersDefaultCellStyle.SelectionBackColor = Color.Empty;

            // Set the background color for all rows and for alternating rows.
            // The value for alternating rows overrides the value for all rows.
            dataGridView1.RowsDefaultCellStyle.BackColor            = Color.LightBlue;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.MediumAquamarine;

            //// Set the text for each button.
            if (result != null && result.objQuestionMas.Count > 0)
            {
                //Get the First Level Node using Parent Node is null
                getParent =
                    (from QuestionMast in result.objQuestionMas
                     where QuestionMast.ParentParentQuestionNo == 0 && QuestionMast.ParentQuestionNo == 0
                     select QuestionMast).ToList();
                dataGridView1.RowCount = getParent.Count;
                for (int prntCnt = 0; prntCnt < getParent.Count; prntCnt++)
                {
                    dataGridView1.Rows[prntCnt].Cells["ProductName"].Value = getParent[prntCnt].Name;

                    if (Utility.IsAdmin())
                    {
                        dataGridView1.Rows[prntCnt].Cells["eTutor"].Value        = "Export";
                        dataGridView1.Rows[prntCnt].Cells["QuestionBank"].Value  = "Export";
                        dataGridView1.Rows[prntCnt].Cells["QuestionPaper"].Value = "Export";
                        dataGridView1.Rows[prntCnt].Cells["MockTest"].Value      = "Export";
                    }
                    else
                    {
                        dataGridView1.Rows[prntCnt].Cells["eTutor"].Value        = getParent[prntCnt].eTutor;
                        dataGridView1.Rows[prntCnt].Cells["QuestionBank"].Value  = getParent[prntCnt].QuesBank;
                        dataGridView1.Rows[prntCnt].Cells["QuestionPaper"].Value = getParent[prntCnt].QuesBankGen;
                        dataGridView1.Rows[prntCnt].Cells["MockTest"].Value      = getParent[prntCnt].MockTest;
                    }
                }
            }

            if (Utility.IsAdmin())
            {
                //button3.Visible = true;
                textBox1.Visible = true;
                button5.Enabled  = false;
                //textBox1.Text = EntropyGenerator.GetIPForMachine();
                label2.Visible = true;
            }
            else
            {
                button3.Visible = false;
                button5.Visible = button6.Visible = textBox1.Visible = false;

                label2.Visible = false;
            }
        }