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

Mansour_Dalir 1,591 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

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,580 questions
{count} votes

Accepted answer
  1. KOZ6.0 4,895 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