예제 #1
0
 private void szukajTextBox_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(szukajTextBox.Text))
     {
         fireDataGridSelectionChanged = false;
         var idx = DataGridBindingSource.Find((System.ComponentModel.PropertyDescriptor)null, szukajTextBox.Text);
         if (idx > -1)
         {
             DataGrid.CurrentCell = DataGrid.Rows[idx].Cells[0];
         }
         else
         {
             szukajTextBox.Text           = szukajTextBox.Text.Substring(0, szukajTextBox.Text.Length - 1);
             szukajTextBox.SelectionStart = szukajTextBox.Text.Length;
         }
         fireDataGridSelectionChanged = true;
     }
 }
예제 #2
0
 private void findTextBox_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(findTextBox.Text) && fireFindTextBoxChanged)
     {
         fireDataGridSelectionChanged = false;
         var idx = DataGridBindingSource.Find("Kod", findTextBox.Text);
         if (idx > -1)
         {
             DataGrid.CurrentCell = DataGrid.Rows[idx].Cells[0];
         }
         else
         {
             findTextBox.Text           = findTextBox.Text.Substring(0, findTextBox.Text.Length - 1);
             findTextBox.SelectionStart = findTextBox.Text.Length;
         }
         fireDataGridSelectionChanged = true;
     }
 }
예제 #3
0
 private void findTextBox_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(findTextBox.Text))
     {
         try
         {
             disableOnSelectionChanged = true;
             int idx = DataGridBindingSource.Find("Kod", findTextBox.Text);
             if (idx != -1)
             {
                 this.DataGrid.CurrentCell = this.DataGrid.Rows[idx].Cells[0];
             }
             else
             {
                 findTextBox.Text           = findTextBox.Text.Substring(0, findTextBox.Text.Length - 1);
                 findTextBox.SelectionStart = findTextBox.Text.Length;
             }
         }
         finally
         {
             disableOnSelectionChanged = false;
         }
     }
 }
예제 #4
0
 private void visibleChanged(int rowIndex)
 {
     DataGridBindingSource.RemoveAt(rowIndex);
 }