3 Answers, 1 is accepted
0
Hello Sakthivel,
Thank you for contacting us.
You can get the top visible row index by accessing the vertical scroll position in grid. Refer to the code snippet below:
You can get the cell location by using the RowIndex and ColumnIndex properties of the GridCellElement. If you need the cell coordinates, use the ControlBoundingRectangle property.
Do not hesitate to write us, if you need further assistance.
All the best,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thank you for contacting us.
You can get the top visible row index by accessing the vertical scroll position in grid. Refer to the code snippet below:
GridVScrollBar vscrollBar = (GridVScrollBar)((GridTableElement)this.radGridView1.GridElement).Children[3]; |
int vindex = vscrollBar.Value; |
You can get the cell location by using the RowIndex and ColumnIndex properties of the GridCellElement. If you need the cell coordinates, use the ControlBoundingRectangle property.
Do not hesitate to write us, if you need further assistance.
All the best,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Ken
Top achievements
Rank 1
answered on 16 Aug 2011, 04:26 PM
Has the way to do this changed for later releases? I don't seem to have GridVScrollBar defined - I'm on 2011 Q2 release.
Thanks
Ken
Thanks
Ken
0
Hi Ken,
Yes, we have changed a lot since 2008. Now RadGridView scrolls smoothly, not row by row. That is why this approach will not work anymore. You can do the job by using the Index property of GridViewRowInfo:
If you have further questions, I will be glad to help.
Best wishes,
Jack
the Telerik team
Yes, we have changed a lot since 2008. Now RadGridView scrolls smoothly, not row by row. That is why this approach will not work anymore. You can do the job by using the Index property of GridViewRowInfo:
public
int
GetFirstVisibleRowIndex(RadGridView grid)
{
foreach
(GridRowElement row
in
this
.radGridView1.TableElement.VisualRows)
{
if
(row.RowInfo
is
GridViewDataRowInfo || row.RowInfo
is
GridViewGroupRowInfo)
{
return
row.RowInfo.Index;
}
}
return
-1;
}
If you have further questions, I will be glad to help.
Best wishes,
Jack
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Dess | Tech Support Engineer, Principal
commented on 14 Jun 2022, 10:07 AM
Telerik team
Hi, Erik,
The above approach is still valid for returning the row index of the first visible row in RadGridView.