This is a migrated thread and some comments may be shown as answers.

HorizontalScrollingOffset in RadGridView

1 Answer 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Amir
Top achievements
Rank 1
Amir asked on 16 Sep 2018, 12:02 PM

How can I get HorizontalScrollingOffset with RadGridView?

I'm trying to refresh the grid and keep the screen in the same horizontal position, I succeeded to do it in vertical position.

Thanks in advance

Amir

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Sep 2018, 01:41 PM
Hello, Amir, 
 
In order to restore the horizontal offset after refreshing, you should keep the TableElement.HScrollBar.Value. You can find below a sample code snippet: 
 
private void radButton1_Click(object sender, EventArgs e)
{
    int horizontalScrollValue = this.radGridView1.TableElement.HScrollBar.Value;
    this.radGridView1.DataSource = null;
    this.radGridView1.DataSource = this.productsBindingSource;
    this.radGridView1.BestFitColumns(Telerik.WinControls.UI.BestFitColumnMode.AllCells);
    this.radGridView1.TableElement.HScrollBar.Value = horizontalScrollValue;
}
 
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 


Should you have further questions please let me know.

Regards,
Dess
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.
Tags
GridView
Asked by
Amir
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or