We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Setting top row index

Thread ID:

Created:

Updated:

Platform:

Replies:

35982 Oct 17,2005 11:24 PM Oct 18,2005 09:30 AM Windows Forms 2
loading
Tags: GridControl
Patrick Noble
Asked On October 17, 2005 11:24 PM

I am having some difficulty getting a specific row to appear at the top of a griddataboundgrid. The grid just displays with the row at index position 0 whatever value I set in the code below. gridCalls.DataSource = DsSchedule1.demand gridCalls.SetTopRow(50) Do I need to do something in addition?

Administrator [Syncfusion]
Replied On October 18, 2005 03:58 AM

Are you trying to do this in Form.Load before the grid is displayed? If so, before the initial display, a ListChanged.Reset event is raised for a DataTable DataSource, and this is causing the toprow to reset. One way around this is to set a timer at the bottom of Form.Load to raise an event slightly later so you can reset the TopRowIndex after the ListChanged.Reset event has been handled. ''at bottom of form.load Dim t As New Timer() t.Interval = 1 AddHandler t.Tick, AddressOf t_Tick t.Start() ''the handler Private Sub t_Tick(sender As Object, e As EventArgs) Dim t As Timer = sender '' t.Stop() t.Dispose() t = Nothing Me.gridDataBoundGrid1.SetTopRow(50) End Sub ''t_Tick

Administrator [Syncfusion]
Replied On October 18, 2005 09:30 AM

That was it. Thanks Clay.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;