Exemple #1
0
 public static void Add(JkDataSet item)
 {
     if (List.Find(l => l.Name == item.Name) == null)
     {
         List.Add(item);
     }
 }
        private void JkDataGridView_EditModeChanged(object sender, EventArgs e)
        {
            foreach (DataGridViewColumn column in this.Columns)
            {
                if (this.Columns[column.Index] is DataGridViewComboBoxColumn)
                {
                    String           controlName = this.DataSet.Columns.Find(c => c.Name == this.Columns[column.Index].DataPropertyName).ControlName;
                    JkLookUpComboBox comboBox    = JkLookUpComboBoxList.FindByName(controlName);
                    JkDataSet        dataSet     = JkDataSetList.FindByName(comboBox.DataSet);

                    if (dataSet.Filtered &&
                        dataSet.Filter != null &&
                        this.EditMode != DataGridViewEditMode.EditProgrammatically &&
                        !String.IsNullOrWhiteSpace(dataSet.Filter))
                    {
                        ((this.Columns[column.Index] as DataGridViewComboBoxColumn).DataSource as DataTable).DefaultView.RowFilter = dataSet.Filter;
                    }
                    else
                    {
                        ((this.Columns[column.Index] as DataGridViewComboBoxColumn).DataSource as DataTable).DefaultView.RowFilter = String.Empty;
                    }
                }
            }
        }