6 Answers, 1 is accepted
0
Hello Yair,
Svett
the Telerik team
You can get the rows that are visible by accessing the VisualRows property of GridTableElement:
public
IEnumerable<GridViewDataRowInfo> GetVisibleDataRows()
{
foreach
(GridRowElement rowElement
in
this
.myRadGridView1.TableElement.VisualRows)
{
if
(rowElement.RowInfo
is
GridViewDataRowInfo)
{
yield
return
rowElement.RowInfo
as
GridViewDataRowInfo;
}
}
}
I hope this helps.
Regards,Svett
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).
0

yair
Top achievements
Rank 1
answered on 31 Jan 2012, 04:00 PM
thanks Svett
i'm using vb.net.
I tried to convert the code to vb.net but i couldn't..
can you write it in vb.net?
i'm using vb.net.
I tried to convert the code to vb.net but i couldn't..
can you write it in vb.net?
0
Hi Yair,
All the best,
Svett
the Telerik team
Here is the VB.NET version of the code snippet that I have sent you previously:
Public
Function
GetVisibleDataRows()
As
IEnumerable(Of GridViewDataRowInfo)
For
Each
rowElement
As
GridRowElement
In
Me
.myRadGridView1.TableElement.VisualRows
If
TypeOf
rowElement.RowInfo
Is
GridViewDataRowInfo
Then
yield
Return
TryCast(rowElement.RowInfo, GridViewDataRowInfo)
End
If
Next
End
Function
Svett
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).
0

yair
Top achievements
Rank 1
answered on 02 Feb 2012, 11:20 PM
it doesn't good.. I converted the c# code by Telerik converter tool too.. it doesn't work well..
the converter dosn't know how to convert the code "yield"
the converter dosn't know how to convert the code "yield"
0
Hi Yair,
Svett
the Telerik team
Here is a valid VB.NET version of my code snippet:
Public
Function
GetVisibleDataRows()
As
List(Of GridViewDataRowInfo)
Dim
result
As
New
List(Of GridViewDataRowInfo)()
For
Each
rowElement
As
GridRowElement
In
Me
.myRadGridView1.TableElement.VisualRows
If
TypeOf
rowElement.RowInfo
Is
GridViewDataRowInfo
Then
result.Add(TryCast(rowElement.RowInfo, GridViewDataRowInfo))
End
If
Next
Return
result
End
Function
I hope this helps.
Svett
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).
0

yair
Top achievements
Rank 1
answered on 07 Feb 2012, 07:35 PM
thanks Svett!!! it's perfect! :-)