datagrids
-
I have a datagrid that displays information based on searches. When I run a search, the datagrid fills and I can scroll through the table. However, let's say I scroll down the list a little, and then decide to run another search. The datagrid fills with the new information and shows the top of the list, but the scroll box doesn't change. Then when I click on the scroll bar the table snaps to where it would be in relation to the scroll bar. How do I make the scroll bar move back to the top when the datagrid fills with new information? (This is on a Windows form btw) Puzzled...
-
I have a datagrid that displays information based on searches. When I run a search, the datagrid fills and I can scroll through the table. However, let's say I scroll down the list a little, and then decide to run another search. The datagrid fills with the new information and shows the top of the list, but the scroll box doesn't change. Then when I click on the scroll bar the table snaps to where it would be in relation to the scroll bar. How do I make the scroll bar move back to the top when the datagrid fills with new information? (This is on a Windows form btw) Puzzled...
Take a look here http://www.syncfusion.com/FAQ/WinForms/FAQ\_c44c.asp#q895q or maybe try setting the current cell like this: Datarid.CurrentCell = New DataGridCell(0, 1)
-
Take a look here http://www.syncfusion.com/FAQ/WinForms/FAQ\_c44c.asp#q895q or maybe try setting the current cell like this: Datarid.CurrentCell = New DataGridCell(0, 1)
thank you - looks like a good site, I'll be bookmarking that! I actually made a little subroutine that deletes the datagrid and then makes a new one. Then the scroll bar goes back to the top. But I will try this too...perhaps less code.
-
thank you - looks like a good site, I'll be bookmarking that! I actually made a little subroutine that deletes the datagrid and then makes a new one. Then the scroll bar goes back to the top. But I will try this too...perhaps less code.
If you are just performing a new query and setting the results to the datagrid then in your routine where you set the datagrids datasource property, always set the datasource to nothing first. Private Sub FillGrid(dg As DataGrid) Dim ds As New DataSet '//Clear Any Data From The Grid dg.DataSource = Nothing '//Do Work To Get Data Here ' ' '//Fill The Grid With Data dg.DataSource = ds End Sub Just An Example. That way your really only had to add one line of code to clear the grid and scrollbar.
-
If you are just performing a new query and setting the results to the datagrid then in your routine where you set the datagrids datasource property, always set the datasource to nothing first. Private Sub FillGrid(dg As DataGrid) Dim ds As New DataSet '//Clear Any Data From The Grid dg.DataSource = Nothing '//Do Work To Get Data Here ' ' '//Fill The Grid With Data dg.DataSource = ds End Sub Just An Example. That way your really only had to add one line of code to clear the grid and scrollbar.
Thank you so much! That did exactly what I wanted and it elminated the need for an extra subroutine.
-
Thank you so much! That did exactly what I wanted and it elminated the need for an extra subroutine.