Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Make active row visible
posted

i have 2 web datagrids  that are in a master detail relationship.  I currently highlight the most relevant record in the child grid but have been unable to scroll it programatically into view if it is not currenlly visible.  I have used selected row to highlight the field and have also set active row to the same field. however, i still have to scroll manually to the highlighted record.  How can i get the row that is selected and active to also be visible.  tks. i am using VB codebehind to do all of this. 

Parents
  • 12679
    Verified Answer
    posted

    Hello Garry,

    You can use ScrollTop property of the WebDataGrid component in order to adjust the scrollbar position according to your requirements. Suppose you have a grid with 30 records and on postback raised by button  you would like to select a row form server-side and then scroll to view you can use code similar to to this one below:

    Protected Sub Button1_Click(sender As Object, e As EventArgs)

    WebDataGrid1.Behaviors.Selection.SelectedRows.Add(WebDataGrid1.Rows(19))

    WebDataGrid1.ScrollTop = 380

    End Sub

    Hope this helps.

     

Reply Children