Thread ID: |
Created: |
Platform: |
Replies: |
15160 | Jun 12,2004 06:13 AM UTC | WinForms | 0 |
![]() |
Tags: FAQ |
Public Function GetSelectedRows(ByVal dg As DataGrid) As System.Collections.ArrayList
Dim al As New ArrayList
Dim cm As CurrencyManager = Me.BindingContext(dg.DataSource, dg.DataMember)
Dim dv As DataView = CType(cm.List, DataView)
Dim i As Integer
For i = 0 To dv.Count - 1
If dg.IsSelected(i) Then
al.Add(i)
End If
End
Next
Return al
End Function ''GetSelectedRows
Private Sub btnMakePDF_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnMakePDF.Click
Dim s As String = "Selected rows:"
Dim o As Object
For Each o In GetSelectedRows(MyDataGrid)
s += " " + o.ToString()
Next o
MessageBox.Show(s)
''MessageBox.Show("Selected items....")
End Sub ''button1_Click
Does anyone know why?
Regards
Magnus This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.