This is a migrated thread and some comments may be shown as answers.
How to find current Scrolled Row
4 Answers 6 Views
This is a migrated thread and some comments may be shown as answers.
Shanti 😎
Top achievements
Rank 2
Shanti 😎 asked on 11 Feb 2020, 07:40 AM

Hi,
If i Scroll to n'th row.
RadGridView.TableElement.ScrollToRow(n)

How to find current Scrolled row ?

Thanks..

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 12 Feb 2020, 05:40 AM

Hello Shanti ,

You can get the entire row that you have scrolled to and iterate through its cell values as follows:

GridViewRowInfo currentRow = this.radGridView1.Rows[n] as GridViewRowInfo;
foreach (GridViewCellInfo cell in currentRow.Cells as GridViewCellInfoCollection)
{
    Console.WriteLine(cell.Value);
}

You can find more information about GridViewRowInfo on the following article: https://docs.telerik.com/devtools/winforms/controls/gridview/rows/gridviewrowinfo

I hope you find this information useful. Please do not hesitate to ask if you have further questions.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Shanti 😎
Top achievements
Rank 2
answered on 12 Feb 2020, 07:42 AM

Hi,

Thanks for reply..

And if i scrolled to last row of gridview how to identify scroll end ?

 

 

0
Accepted
Dimitar
Telerik team
answered on 12 Feb 2020, 09:56 AM

Hello Shanti,

If you would like to determine if you have scrolled to the last row of RadGridVIew you can achieve this by subscribing to the ValueChanged event of VerticalScrollBar. Then you can calculate whether the current VerticalScrollBar value is equal to the maximum value:

this.radGridView1.TableElement.VScrollBar.ValueChanged += VScrollBar_ValueChanged;


private void VScrollBar_ValueChanged(object sender, EventArgs e)
{
    int scrollBarMaxValue = (this.radGridView1.TableElement.VScrollBar.Maximum - this.radGridView1.TableElement.VScrollBar.LargeChange) + 1
    int scrollBarCurrentValue = this.radGridView1.TableElement.VScrollBar.Value;

    if (scrollBarCurrentValue == scrollBarMaxValue)
    {
        //TODO Implement your code
    }
}

Please note that the value of a scroll bar cannot reach its maximum value through user interaction at run time. The maximum value that can be reached is equal to the Maximum property value minus the RadScrollBarElement.LargeChange property value plus 1. The maximum value can only be reached programmatically.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Shanti 😎
Top achievements
Rank 2
answered on 12 Feb 2020, 11:14 AM
Thank you Dimitar! It worked perfect.. 😊🙌
Asked by
Shanti 😎
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Shanti 😎
Top achievements
Rank 2
Share this question
or