Exemple #1
0
 private void dgv_loadFiles1_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         change_all_selected_cells(dgv_loadFiles1);
     }
 }
 void dataGridView1_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         if (e.ColumnIndex == dataGridView1.Columns["Status"].Index)
         {
             try
             {
                 var menuItems = new System.Collections.Generic.List <string>()
                 {
                     "Принят", "Склад", "Продан", "Удалить"
                 };
                 var menu = new System.Windows.Forms.ContextMenu();
                 menuItems.Remove(dataGridView1["Status", e.RowIndex].Value.ToString());
                 foreach (var m in menuItems)
                 {
                     menu.MenuItems.Add(m, new System.EventHandler(menuClick));
                 }
                 ;
                 dataGridView1.Rows[e.RowIndex].Selected = true;
                 menu.Show(dataGridView1, new System.Drawing.Point(e.Location.X + 200, e.Location.Y));
             }
             catch { }
         }
     }
 }
Exemple #3
0
 private void dgv_proteoform_families_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     if ((cmbx_tableSelector.SelectedIndex == 0 || cmbx_tableSelector.SelectedIndex > 4) && e.RowIndex >= 0)
     {
         display_family_members(e.RowIndex, e.ColumnIndex);
     }
 }
 private void ShowPopUp_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         string productCode = UnleashedData.Rows[e.RowIndex].Cells[0].Value.ToString();
         ProductDetailWindow productDetail = new MRPTool.ProductDetailWindow(productCode);
         productDetail.Show();
     }
 }
        private void CellMouseDownHandler(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
        {
            if (!this.VerticalDragScroll)
            {
                return;
            }

            this.MouseDownOnCell            = true;
            this.MouseDownPosition          = e.Y + this.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Y;
            this.MouseDownFirstDisplayedRow = this.FirstDisplayedScrollingRowIndex;
        }
Exemple #6
0
        private void ShowPopUp_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                string productCode = UnleashedData.Rows[e.RowIndex].Cells[0].Value.ToString();
                ProductDetailWindow productDetail = new MRPTool.ProductDetailWindow(productCode);

                productDetail.Show();
                //var responseProducts = UnLeashedMain.GetJson("Products/1", ApiId, ApiKey, "");
                //var dtProducts = JsonConvert.DeserializeObject<ULProducts>(responseProducts);
                ////ItemsProducts.AddRange(dtProducts.Items);
                //MessageBox.Show("Files are missing,please provide all the files.", "Warning");
            }
        }
        private void UserDataGridView_CellMouseDoubleClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            if (e.ColumnIndex == -1)
            {
                return;
            }

            string username = userDataGridView.CurrentRow.Cells[2].Value.ToString();

            UserSearch(username: username);
        }
 void dataGridView1_ColumnHeaderMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex > 0)
     {
         MetaField fi = metaType.Fields[e.ColumnIndex - 1];
         if (fi.FieldType == null || typeof(IList).IsAssignableFrom(fi.FieldType))//complex type
         {
             return;
         }
     }
     if (currentSortedColumn != -1)
     {
         dataGridView1.Columns[currentSortedColumn].HeaderCell.SortGlyphDirection = System.Windows.Forms.SortOrder.None;
         dataGridView1.Columns[currentSortedColumn].HeaderCell.Style.BackColor    = System.Drawing.SystemColors.Control;
     }
     if (e.ColumnIndex == currentSortedColumn)
     {
         if (currentSortOrder == System.Windows.Forms.SortOrder.Ascending)
         {
             dataGridView1.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = System.Windows.Forms.SortOrder.Descending;
             currentSortOrder = System.Windows.Forms.SortOrder.Descending;
         }
         else
         {
             dataGridView1.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = System.Windows.Forms.SortOrder.Ascending;
             currentSortOrder = System.Windows.Forms.SortOrder.Ascending;
         }
     }
     else
     {
         dataGridView1.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = System.Windows.Forms.SortOrder.Ascending;
         currentSortOrder = System.Windows.Forms.SortOrder.Ascending;
     }
     dataGridView1.Columns[e.ColumnIndex].HeaderCell.Style.BackColor = System.Drawing.SystemColors.ControlDark;
     currentSortedColumn = e.ColumnIndex;
     this.SortByColumn();
 }
Exemple #9
0
 private void dgv_AggregatedProteoforms_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     CellClick(e.RowIndex);
 }
 private void UnleashedData_CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     firstSelectedRow = e.RowIndex;
     // UnleashedData.Rows[e.RowIndex].DefaultCellStyle.BackColor = System.Drawing.Color.Green;
 }
Exemple #11
0
        private static void DataGridView_OnColumnHeaderMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
        {
            System.Windows.Forms.DataGridView grid = (System.Windows.Forms.DataGridView)sender;

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                if (grid.Columns[e.ColumnIndex].Tag != null && telaFiltro == null)
                {
                    telaFiltro = new MontagemFiltro();

                    FilterSettings.Filtro filtro = (FilterSettings.Filtro)grid.Columns[e.ColumnIndex].Tag;

                    telaFiltro.TituloFiltro           = new System.Windows.Forms.Label();
                    telaFiltro.TituloFiltro.Location  = new System.Drawing.Point(filtro.PosicaoCabecalhoGrid.X + 1, filtro.PosicaoCabecalhoGrid.Y + 1);
                    telaFiltro.TituloFiltro.Size      = new System.Drawing.Size(filtro.PosicaoCabecalhoGrid.Width - 3, filtro.PosicaoCabecalhoGrid.Height - 1);
                    telaFiltro.TituloFiltro.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                    telaFiltro.TituloFiltro.Font      = StyleSettings.Fonte_Grid;
                    telaFiltro.TituloFiltro.Text      = filtro.Nome;
                    telaFiltro.TituloFiltro.BackColor = System.Drawing.Color.FromArgb(120, 120, 120);
                    telaFiltro.TituloFiltro.ForeColor = System.Drawing.Color.White;
                    grid.Controls.Add(telaFiltro.TituloFiltro);

                    telaFiltro.PainelFiltro             = new System.Windows.Forms.Panel();
                    telaFiltro.PainelFiltro.Location    = new System.Drawing.Point(filtro.PosicaoCabecalhoGrid.X, filtro.PosicaoCabecalhoGrid.Y + filtro.PosicaoCabecalhoGrid.Height);
                    telaFiltro.PainelFiltro.Size        = filtro.Tamanho;
                    telaFiltro.PainelFiltro.BorderStyle = System.Windows.Forms.BorderStyle.None;
                    telaFiltro.PainelFiltro.BackColor   = System.Drawing.Color.FromArgb(120, 120, 120);
                    grid.Controls.Add(telaFiltro.PainelFiltro);


                    painelControle.Name      = "painelControle";
                    painelControle.Location  = new System.Drawing.Point(1, 1);
                    painelControle.Size      = new System.Drawing.Size(telaFiltro.PainelFiltro.Size.Width - 2, telaFiltro.PainelFiltro.Size.Height - 2);
                    painelControle.BackColor = System.Drawing.Color.FromArgb(60, 60, 60);
                    telaFiltro.PainelFiltro.Controls.Add(painelControle);

                    System.Windows.Forms.RadioButton chkAscendente = new System.Windows.Forms.RadioButton();
                    chkAscendente.Text      = "Ascendente";
                    chkAscendente.Font      = new System.Drawing.Font("Calibri", 9f, System.Drawing.FontStyle.Bold);
                    chkAscendente.Location  = new System.Drawing.Point(10, 5);
                    chkAscendente.BackColor = System.Drawing.Color.Transparent;
                    chkAscendente.ForeColor = System.Drawing.Color.White;
                    chkAscendente.Checked   = filtro.Ascendente;
                    painelControle.Controls.Add(chkAscendente);

                    System.Windows.Forms.RadioButton chkDescendente = new System.Windows.Forms.RadioButton();
                    chkDescendente.Text      = "Descendente";
                    chkDescendente.Font      = new System.Drawing.Font("Calibri", 9f, System.Drawing.FontStyle.Bold);
                    chkDescendente.Location  = new System.Drawing.Point(10, 25);
                    chkDescendente.BackColor = System.Drawing.Color.Transparent;
                    chkDescendente.ForeColor = System.Drawing.Color.White;
                    chkDescendente.Checked   = !filtro.Ascendente;
                    painelControle.Controls.Add(chkDescendente);

                    System.Windows.Forms.GroupBox linha = new System.Windows.Forms.GroupBox();
                    linha.Location  = new System.Drawing.Point(5, 50);
                    linha.Size      = new System.Drawing.Size(telaFiltro.PainelFiltro.Size.Width - 10, 1);
                    linha.ForeColor = System.Drawing.Color.FromArgb(90, 90, 90);
                    painelControle.Controls.Add(linha);

                    int posY = 65;
                    foreach (FilterSettings.CamposFiltro campo in filtro.CamposTextBox)
                    {
                        System.Windows.Forms.Label label = new System.Windows.Forms.Label();
                        label.Text      = campo.Descricao;
                        label.Location  = new System.Drawing.Point(10, posY);
                        label.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
                        label.Size      = campo.DescricaoTamanho;
                        label.ForeColor = System.Drawing.Color.White;
                        painelControle.Controls.Add(label);

                        System.Windows.Forms.TextBox textBox = new System.Windows.Forms.TextBox();
                        textBox.Text     = (String)campo.Conteudo;
                        textBox.Font     = new System.Drawing.Font("Calibri", 11.25f, System.Drawing.FontStyle.Bold);
                        textBox.Location = new System.Drawing.Point(20 + label.Size.Width, posY - 5);
                        textBox.Size     = campo.ConteudoTamanho;
                        painelControle.Controls.Add(textBox);

                        posY += 28;
                    }

                    foreach (FilterSettings.CamposFiltro campo in filtro.CamposBuscaTextBox)
                    {
                        System.Windows.Forms.Label label = new System.Windows.Forms.Label();
                        label.Text      = campo.Descricao;
                        label.Location  = new System.Drawing.Point(10, posY);
                        label.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
                        label.Size      = campo.DescricaoTamanho;
                        label.ForeColor = System.Drawing.Color.White;
                        painelControle.Controls.Add(label);

                        System.Windows.Forms.TextBox textBox = new System.Windows.Forms.TextBox();
                        textBox.Text     = (String)campo.Conteudo;
                        textBox.Font     = new System.Drawing.Font("Calibri", 11.25f, System.Drawing.FontStyle.Bold);
                        textBox.Location = new System.Drawing.Point(20 + label.Size.Width, posY - 5);
                        textBox.Size     = campo.ConteudoTamanho;
                        //textBox.KeyPress += new KeyPressEventHandler(textBox_KeyPress);
                        textBox.KeyDown += new System.Windows.Forms.KeyEventHandler(textBox_KeyDown);
                        painelControle.Controls.Add(textBox);

                        posY += 28;
                    }

                    foreach (FilterSettings.CamposFiltro campo in filtro.CamposComboBox)
                    {
                        System.Windows.Forms.Label label = new System.Windows.Forms.Label();
                        label.Text      = campo.Descricao;
                        label.Location  = new System.Drawing.Point(10, posY);
                        label.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
                        label.Size      = campo.DescricaoTamanho;
                        label.ForeColor = System.Drawing.Color.White;
                        label.Font      = new System.Drawing.Font("Calibri", 9.75f, System.Drawing.FontStyle.Bold);
                        painelControle.Controls.Add(label);

                        System.Windows.Forms.ComboBox comboBox = new System.Windows.Forms.ComboBox();
                        comboBox.Font = new System.Drawing.Font("Calibri", 9.75f, System.Drawing.FontStyle.Bold);
                        foreach (String item in (List <String>)campo.Conteudo)
                        {
                            comboBox.Items.Add(item);
                        }
                        comboBox.SelectedIndex = 0;
                        comboBox.Location      = new System.Drawing.Point(15 + label.Size.Width, posY);
                        comboBox.Size          = campo.ConteudoTamanho;
                        painelControle.Controls.Add(comboBox);

                        posY += 28;
                    }

                    foreach (FilterSettings.CamposFiltro campo in filtro.CamposCheckBox)
                    {
                        System.Windows.Forms.Label label = new System.Windows.Forms.Label();
                        label.Text      = campo.Descricao;
                        label.Location  = new System.Drawing.Point(10, posY);
                        label.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
                        label.Size      = campo.DescricaoTamanho;
                        label.ForeColor = System.Drawing.Color.White;
                        painelControle.Controls.Add(label);

                        System.Windows.Forms.CheckedListBox checkedListBox = new System.Windows.Forms.CheckedListBox();
                        checkedListBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        checkedListBox.Font        = new System.Drawing.Font("Calibri", 9.75f, System.Drawing.FontStyle.Bold);
                        foreach (String item in (List <String>)campo.Conteudo)
                        {
                            if (!gListaClientes.Contains(item))
                            {
                                gListaClientes.Add(item);
                            }

                            checkedListBox.Items.Add(item);
                        }
                        //checkedListBox.SelectedIndex = 0;
                        checkedListBox.Location              = new System.Drawing.Point(15 + label.Size.Width, posY);
                        checkedListBox.Size                  = campo.ConteudoTamanho;
                        checkedListBox.CheckOnClick          = true;
                        checkedListBox.Name                  = "checkedListBox";
                        checkedListBox.SelectedIndexChanged += new EventHandler(CheckedListBox_OnSelectedIndexChanged);
                        painelControle.Controls.Add(checkedListBox);

                        posY += 28;
                    }

                    if (filtro.BotaoOK != null)
                    {
                        System.Windows.Forms.Button botaoOk = new System.Windows.Forms.Button();
                        botaoOk.Text     = "Filtrar";
                        botaoOk.Font     = new System.Drawing.Font("Calibri", 9.75f, System.Drawing.FontStyle.Bold);
                        botaoOk.Location = new System.Drawing.Point(painelControle.Size.Width - 160, painelControle.Size.Height - 35);
                        botaoOk.Size     = new System.Drawing.Size(70, 25);
                        //botaoOk.Click += new EventHandler<FiltrarEventArgs>(filtro.BotaoOK.Handler);
                        botaoOk.Click -= new EventHandler(FilterButton_OnClick);
                        botaoOk.Click += new EventHandler(FilterButton_OnClick);
                        //EventFiltrar += filtro.BotaoOK.Handler;
                        //botaoOk.Click += new EventHandler(filtro.BotaoOK.Handler);
                        painelControle.Controls.Add(botaoOk);
                    }
                    else
                    {
                        System.Windows.Forms.Button botaoOk = new System.Windows.Forms.Button();
                        botaoOk.Text     = "Filtrar";
                        botaoOk.Font     = new System.Drawing.Font("Calibri", 9.75f, System.Drawing.FontStyle.Bold);
                        botaoOk.Location = new System.Drawing.Point(painelControle.Size.Width - 160, painelControle.Size.Height - 35);
                        botaoOk.Size     = new System.Drawing.Size(70, 25);
                        botaoOk.Click   += new EventHandler(FilterButtonOK_OnClick);
                        painelControle.Controls.Add(botaoOk);
                    }
                    System.Windows.Forms.Button botaoCancel = new System.Windows.Forms.Button();
                    botaoCancel.Text     = "Cancelar";
                    botaoCancel.Font     = new System.Drawing.Font("Calibri", 9.75f, System.Drawing.FontStyle.Bold);
                    botaoCancel.Location = new System.Drawing.Point(painelControle.Size.Width - 80, painelControle.Size.Height - 35);
                    botaoCancel.Size     = new System.Drawing.Size(70, 25);
                    botaoCancel.Click   += new EventHandler(FilterButtonCancel_OnClick);
                    painelControle.Controls.Add(botaoCancel);

                    painelControle.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(PanelControle_OnPreviewKeyDown);

                    ConfigureControl(telaFiltro.PainelFiltro);
                    telaFiltro.PainelFiltro.BringToFront();
                }
                else
                {
                    if (telaFiltro != null)
                    {
                        telaFiltro.PainelFiltro.BringToFront();
                    }
                }
            }
        }
 void DataGridView1CellMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     //	Log("1111");
 }
 private void dataGridView1_Rightclick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
 {
     throw new System.NotImplementedException();
 }