Krumpuss
Krumpuss

Reputation: 53

Two datagrids that share scroll positions, share datasource but do not sync scroll postion

Hello Stack Overflow,

I have a winforms application that has a two data grid views in the same control that point to the same bindingsource. The purpose of this is to show the column 'customer's name' at all time and allow the rest of the datagrid to be reviewed (scrolled horizontally).

Is there any way i can sync these two up? Currently if the user scrolls vertically down the list of customers, only one datagrid is affected. Do I need to remove scroll bars from one, and cause it to spin both views?

Thanks

Upvotes: 3

Views: 1556

Answers (1)

Amiram Korach
Amiram Korach

Reputation: 13296

You can use the Scroll event of the first grid and set the scroll offset of the second grid with the value of the first grid scroll

Upvotes: 2

Related Questions