title: How do I assign selected WPF datagrid row columns to variables. (VB.NET)
body: <p>I have a datagrid with customer data such as ID, name, email, phone etc.
  When I select a row (with a button or selectionchanged) I want to store that row's columns in variables like</p>
  
  <p>dim email as string
  dim name as string
  email = dgCustomers.theselectedrow.theselectedcell
  name = dgCustomers.theselectedrow.theselectedcell</p>
  
  <p>If I have a datatable with only one row I know I can get column data with:
  dim email as string = CustomerDataTableInstance.rows(0).Item("Email")</p>
  
  <p>I don't know how to get the selected row number though when I have several rows and the user clicks one/uses the keyboard.</p>
  
  <p>The datagrid is bound to a datatable, not a class with object collections.</p>
  
  <p>Any help is appreciated!</p>