private void BillDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 7)
            {
                if (DynamicPanel == null || DynamicPanel.IsDisposed)
                {
                    DynamicPanel = new DynamicDateTimePicker.DynamicDateTimePicker(BillDataGridView, e.ColumnIndex, e.RowIndex);
                    this.Controls.Add(DynamicPanel);
                    DynamicPanel.SetLocation(Cursor.Position);
                    DynamicPanel.BringToFront();
                    DynamicPanel.Show();
                }
                else
                {
                    DynamicPanel.Show();
                    DynamicPanel.BringToFront();
                }
            }
            if (e.ColumnIndex == 8)
            {
                o1 = new OpenFileDialog();

                o1.Filter = "Image Files|*.jpg;*.jpeg;*.png;";
                if (o1.ShowDialog() == DialogResult.OK)
                {
                    BillDataGridView[e.ColumnIndex, e.RowIndex].Value = Image.FromFile(o1.FileName);

                    IsImgUploaded = true;
                    //GraphicsPath gp = new GraphicsPath();
                    //gp.AddEllipse(pictureBox1.DisplayRectangle);
                    //pictureBox1.Region = new Region(gp);
                }
            }
        }
Exemple #2
0
        private void BillDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            Point p = PointToClient(Cursor.Position);

            if (e.ColumnIndex == 6)
            {
                if (DynamicPanel == null || DynamicPanel.IsDisposed)
                {
                    DynamicPanel = new DynamicDateTimePicker.DynamicDateTimePicker(BillDataGridView, e.ColumnIndex, e.RowIndex);
                    this.Controls.Add(DynamicPanel);
                    DynamicPanel.SetLocation(Cursor.Position);
                    DynamicPanel.BringToFront();
                    DynamicPanel.Show();
                }
                else
                {
                    DynamicPanel.Show();
                    DynamicPanel.BringToFront();
                }
            }
            if (e.ColumnIndex == 7)
            {
                o1 = new OpenFileDialog();

                o1.Filter = "Image Files|*.jpg;*.jpeg;*.png;";
                if (o1.ShowDialog() == DialogResult.OK)
                {
                    BillDataGridView[e.ColumnIndex, e.RowIndex].Value = Image.FromFile(o1.FileName);

                    IsImgUploaded = true;
                }
            }
            if (e.ColumnIndex == 2)
            {
                try
                {
                    string dname = embroideryOrder.ReadFabricInfoDesignName(BillDataGridView.Rows[e.RowIndex].Cells[1].Value.ToString());
                    if (!string.IsNullOrWhiteSpace(dname))
                    {
                        BillDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = dname;
                    }
                }
                catch (NullReferenceException) { }
            }
        }