Getting highlighted rows from datagrid in windows form.

Posted on 2005-04-05
Last Modified: 2010-04-23
Hi experts how can i get row numbers of all the highlighted rows
in datagrid control which is on windows form?

Question by:LorneBackler
    LVL 9

    Expert Comment

    LVL 14

    Accepted Solution

    If your datasource of the datagrid is datatable:

    Dim rowNos As New ArrayList()

    Dim i As Integer
    For i = 0 to myDataSet.Tables("myTable").Rows.Count - 1
            If DataGrid1.IsSelected(i) Then
            End If
    End Next

    Author Comment

    thanks s lot  Amyhxu

    it work fine!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now