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. Image for the cookie policy date
close icon

Setting top row index

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?

2 Replies

AD Administrator Syncfusion Team October 18, 2005 07:58 AM UTC

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


AD Administrator Syncfusion Team October 18, 2005 01:30 PM UTC

That was it. Thanks Clay.

Loader.
Live Chat Icon For mobile
Up arrow icon