We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

no hit..

Thread ID:




15161 Jun 12,2004 02:10 PM UTC WinForms 0
Tags: FAQ
Asked On June 12, 2004 02:10 PM UTC

Hi I try to loop through a datagrid to see if the checkbox in the datagrid is selected using this code.. 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) Else al.Add("no hit no: " & i & vbCrLf) 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...." & vbCrLf) 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 But it never indicate that a checkbox is selected even though I select checkboxes. What am I missing here? 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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon