1

i`m try to get String Parameters From GridView Devexpress VB.net to send to Stored Procedure Haw Can i loop in GridView to get All SelectedCells To send

enter image description here

enter image description here

Willie Cheng
  • 7,679
  • 13
  • 55
  • 68
Ahmed A
  • 13
  • 5
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 18 '22 at 07:39
  • i want to loop in Data grid view to get all selected Cell – Ahmed A Aug 18 '22 at 09:46
  • IMO, you actually want to forget trying to do any sort of looping over the the XtraGridView. You would find this far simpler to loop over the collection you've bound. You've got some choices here. You could run a SQL update command in a loop, updating params on each iteration. Or maybe something along the lines of https://stackoverflow.com/questions/11102358/how-to-pass-an-array-into-a-sql-server-stored-procedure – Hursey Aug 18 '22 at 21:02

1 Answers1

0

You loop throught the selecting rows and the you get the value of the row's value.

Also, you will need to enable the option "MultiSelect".

In this code there are 2 ways to select the cell, with fieldname or with column_id.

     For Each rowHandle As Integer In GridView1.GetSelectedRows

        'Dim valueOption1 As String = gridView1.GetRowCellValue(selectedRowHandles(rowHandle), "FieldName")  
'Dim valueOption2 As String = gridView1.GetRowCellValue(selectedRowHandles(rowHandle), GridView1.Columns(column_id))

    Next  
S3minaki
  • 297
  • 3
  • 19