locked
Looping through aspxgridview rows RRS feed

  • Question

  • User1343581070 posted

    Hi,

           I am using an aspxgridview (devexpress controls) and want to loop through all the rows in vb.net

     

    Please help

    regards

    sanjish 

    Friday, January 30, 2015 2:24 AM

All replies

  • User-1509636757 posted

    You can iterate from 1 to VisibleRowCount of ASPXGridView like:

            For index = 1 To ASPxGridView1.VisibleRowCount
                '' your code
            Next

    hope it helps./.

    Friday, January 30, 2015 4:17 AM
  • User61956409 posted

    Hi sanjish,

    Thanks for your post.

    You could refer to the following sample to loop through gridview rows.

    For Each dr As GridViewRow In GridView1.Rows
        'your code
    Next
    

    Best Regards,

    Fei Han

    Friday, January 30, 2015 4:42 AM
  • User1343581070 posted

    Hi,

          I want to loop through all the rows not just the visible rows

    regards

    sanjish

    Friday, January 30, 2015 6:05 AM
  • User-1509636757 posted

    I want to loop through all the rows not just the visible rows

    I guess, this would only be possible if you are not using paging.

    Friday, January 30, 2015 6:53 AM
  • User1343581070 posted

    Hi,

            I am not using paging and want to save the grid as a batch when I save the web form

    regards

    sanjish

    Friday, January 30, 2015 8:22 AM
  • User61956409 posted

    Hi sanjish,

    For Each dr As GridViewRow In GridView1.Rows
        'your code
    Next

    You are not using paging, so all records will be displayed in GridView in one page. Have you tried the above code to loop through gridview rows?

    Best Regards,

    Fei Han

    Monday, February 2, 2015 1:36 AM
  • User1343581070 posted

    Hi,

           I am using aspxgridview (devexpress product) not asp.net gridview hence your loop will not work.

    Regards

    sanjish

    Monday, February 2, 2015 2:45 AM