How to Get address datagridview cells row by row to an array Linq

Mansour_Dalir 2,036 Reputation points
2024-04-26T15:52:24.5033333+00:00

I do not want to address this way. Is there another way of LINQ?

And if there is no way with linq, with a function that obtains cell addresses row by row

   Dim AddressCells As DataGridViewCell() = {dgv.Rows(0).Cells(0), dgv.Rows(0).Cells(1), dgv.Rows(0).Cells(2)}

need Array as...

enter image description here

Developer technologies | VB
{count} votes

Answer accepted by question author
  1. KOZ6.0 6,735 Reputation points
    2024-04-27T00:05:56.2566667+00:00

    How about this ?

    Dim AddressCells As DataGridViewCell() =
        (From row As DataGridViewRow In dgv.Rows
         From cell As DataGridViewCell In row.Cells
         Select cell).ToArray()
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.