/// <summary> /// Remove the datagridview group /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void labelRemove_Click(object sender, EventArgs e) { try { if (OnRemoveClick != null) { DbEventArgs eventArg = new DbEventArgs(this); OnRemoveClick(sender, eventArg); } } catch (Exception oEx) { LoggingHelper.ShowMessage(oEx); } }
/// <summary> /// Rainse an event OnQueryBuilderRemoveClick /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridViewGroup_OnRemoveClick(object sender, DbEventArgs e) { try { if (e.Data is DataGridViewGroup) { DataGridViewGroup dataGridViewGroup = (DataGridViewGroup)e.Data; int dataGridViewGroupHeight = dataGridViewGroup.Height; if (dataGridViewGroup.Parent is TableLayoutPanel) { TableLayoutPanel tableLayoutPanelQueries = dataGridViewGroup.Parent as TableLayoutPanel; tableLayoutPanelQueries.Controls.Remove(dataGridViewGroup); QueryGroupCount--; tableLayoutPanelQueries.RowCount = QueryGroupCount; tableLayoutPanelQueries.Height = tableLayoutPanelQueries.Height - dataGridViewGroupHeight; } } CheckForDataGridViewQueryRows(); RenameQueryGroupCaption(); } catch (Exception oEx) { LoggingHelper.ShowMessage(oEx); } }
/// <summary> /// Raise an event OnQueryBuilderDataGridIndexChanged /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void dataGridViewGroup_OnDataGridViewComboBoxIndexChanged(object sender, DbEventArgs e) { dbDataGridView datagrid = e.Data as dbDataGridView; try { OMETrace.WriteFunctionStart(); string operatorColumnName = Helper.GetResourceString(Constants.QUERY_GRID_OPERATOR); int operatorColumnIndex = datagrid.Columns[operatorColumnName].Index; if (datagrid.CurrentCell.ColumnIndex == operatorColumnIndex) { if (datagrid.Rows.Count > 1) { string operatorValue = ((ComboBox)sender).SelectedItem.ToString(); for (int i = 1; i < datagrid.Rows.Count; i++) { datagrid.Rows[i].Cells[operatorColumnName].Value = operatorValue; } } } OMETrace.WriteFunctionEnd(); } catch (Exception oEx) { LoggingHelper.ShowMessage(oEx); } }