Below is what I finally got to work so I can create an email list.
Thanks for all the help and pointing me in the right direction.
Private Sub bMail_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bMail.Click
Dim systemDirectory, mList, readVal, curCell As String
Dim Exists As Boolean
systemDirectory = System.Environment.SystemDirectory & "\"
mList = systemDirectory & "mailList.txt"
Exists = System.IO.File.Exists(mList)
If Exists = True Then
System.IO.File.Delete(mList)
End If
FileOpen(1, mList, OpenMode.Append)
For x As Integer = 0 To DataSet11.Employees.Count - 1
If Me.DataGrid1.IsSelected(x) = True Then
curCell = DataGrid1.Item(x, 3)
WriteLine(1, curCell)
Else
End If
Next
FileClose()
End Sub
""Peter Huang" [MSFT]" <v-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I think you may to use the code below to get the selected rows.
> Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles DataGrid1.Click
> Dim cm As CurrencyManager =
> CType(BindingContext(DataGrid1.DataSource, DataGrid1.DataMember),
> CurrencyManager)
> Dim dv As DataView = CType(cm.List, DataView)
> For x As Integer = 0 To dv.Count - 1
> If (DataGrid1.IsSelected(x)) Then
> Debug.WriteLine(String.Format("{0} is selected", x))
> Dim drv As DataRowView = dv(x)
> Debug.WriteLine(drv("CustomerID").ToString())
> End If
> Next
> End Sub
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>