I wanted to see if I can use LINQ on RADGridView's GridViewRowCollection (Telerik.Wincontrols.UI.GridViewRowCollection).
So I tried the following VB.NET code and got an error:
... when I then tried to check the value of lockedRows.Count. So i tried changing it around a little bit to:
But then got the following error (which I've somewhat abbreviated for briefness):
Unable to cast object of type 'WhereSelectEnumerableIterator'2[Telerik.WinControls.UI.GridViewRowInfo, VB$AnonymousType_0'6
[System.Object, ...]]' to type 'System.Collections.Generic.IEnumerable'1[Telerik.WinControls.UI.GridViewRowInfo]'.
So, the first question is, can I use LINQ on GridView's GridViewRowCollection. Secondly, if so, how (can you show me using my example code, above, where I'm trying to pull out the locked rows from a GridView (
Thanks in advance for your help from a LINQ and RADGridView Newbie.
So I tried the following VB.NET code and got an error:
Dim lockedRows = _
From row In Me.dgTotalCosts.Rows _
Where row.Cells("colLocked").Value = True
Select New With {.Code = row.Cells("colCode").Value, _
.Description = row.Cells("colDesc").Value}
... when I then tried to check the value of lockedRows.Count. So i tried changing it around a little bit to:
Dim lockedRows As IEnumerable(Of Telerik.WinControls.UI.GridViewRowInfo) = _
From row As Telerik.WinControls.UI.GridViewRowInfo In Me.dgTotalCosts.Rows _
Where row.Cells("colLocked").Value = True
Select New With {.Code = row.Cells("colCode").Value, _
.Description = row.Cells("colDesc").Value}
But then got the following error (which I've somewhat abbreviated for briefness):
Unable to cast object of type 'WhereSelectEnumerableIterator'2[Telerik.WinControls.UI.GridViewRowInfo, VB$AnonymousType_0'6
[System.Object, ...]]' to type 'System.Collections.Generic.IEnumerable'1[Telerik.WinControls.UI.GridViewRowInfo]'.
So, the first question is, can I use LINQ on GridView's GridViewRowCollection. Secondly, if so, how (can you show me using my example code, above, where I'm trying to pull out the locked rows from a GridView (
Telerik.WinControls.UI.
RadGridView
)?
Thanks in advance for your help from a LINQ and RADGridView Newbie.