2011-09-25 15 views

답변

0

나는 당신의 질문을 정말로 이해하지 못합니다. 하나의 셀을 선택하려는 경우 celldoubleclick 이벤트를 사용할 수 있습니다. 그리고 선택한 셀을 가져 오려면 e.rowindex와 e.columnindex를 사용합니다.이 행은 셀이 위치한 행과 열을 제공합니다.

+0

디렉토리 나 폴더에서 볼 수 있듯이 간단한 검색 기능을 추가하려고합니다. 'u'를 입력하면 'ab'와 같이 ab로 시작하는 모든 파일이 dataGridView에 적용하려는 첫 번째 동일한 종류로 나열됩니다. – user963702

0

가능한 해결책으로 시도해 볼 수 있습니다.

Dim nwData as CustomersDataSet = CustomersDataSet.GetCustomers() 
m_CustomersGrid.DataSource = m_CustomersBindingSource 
m_CustomersBindingSource.DataSource = nwData.Customers 

Then you can sort using the BindingSource. 

CustomersBindingSource.Sort = "ContactName ASC" 

And you can find using the BindingSource. 

Dim index as integer = _ 
CustomersBindingSource.Find("CompanyName", CompanyNameTextBox.Text) 
If index <-1 then 'it was found; move to that position 
CustomersBindingSource.Position = index 
End If 

그런 다음 채울 수 : 그들을 캡처하여 셀에 누른 키

CustomersBindingSource.Find("CompanyName", CompanyNameTextBox.Text) 

을 이용하여 : This Location

:
Private Sub DataGridView1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyUp 
     Dim dgv As DataGridView = TryCast(sender, DataGridView) 

     If dgv IsNot Nothing Then 

      'You will need some logic here to determine how long to wait between keyups 
      'Perhaps a timer that ticks every500 milliseconds and reset on keyup. 
e.KeyData 
      End If 
     End Sub 

나는에서 원래 기다리고 소스 논리를 발견
관련 문제