Click here to Skip to main content
15,903,203 members
Home / Discussions / C#
   

C#

 
AnswerRe: PDF417 Barcode generator SDK. Pin
louthy17-Aug-11 2:20
louthy17-Aug-11 2:20 
QuestionException Handling and Logging in windows application Pin
arun_pk16-Aug-11 19:10
arun_pk16-Aug-11 19:10 
AnswerRe: Exception Handling and Logging in windows application Pin
DaveAuld16-Aug-11 19:34
professionalDaveAuld16-Aug-11 19:34 
AnswerRe: Exception Handling and Logging in windows application Pin
jschell17-Aug-11 9:07
jschell17-Aug-11 9:07 
QuestionLinking the scroll bars of two controls Pin
Dewald16-Aug-11 3:58
Dewald16-Aug-11 3:58 
AnswerRe: Linking the scroll bars of two controls Pin
Luc Pattyn16-Aug-11 4:28
sitebuilderLuc Pattyn16-Aug-11 4:28 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald16-Aug-11 21:55
Dewald16-Aug-11 21:55 
AnswerRe: Linking the scroll bars of two controls Pin
BobJanova16-Aug-11 4:54
BobJanova16-Aug-11 4:54 
Have you tried: inheriting from DataGridView (gives you access to VerticalScrollBar), and putting some sort of synchronisation on your class?

class MyGrid : DataGridView {
 public static void Link(IEnumerable<MyGrid> grids){ 
  foreach(MyGrid grid in grids) 
   grid.VerticalScrollBar.Scroll += (s,e) => HandleScroll(grids, e.NewValue);
  
 }

 static void HandleScroll(IEnumerable<MyGrid> grids, int value){
  foreach(MyGrid grid in grids) grid.VerticalScrollBar.Value = value;
 }
}


And call it like:
var grids = List<MyGrid>();
grids.Add(myFirstGrid);
grids.Add(mySecondGrid);

MyGrid.Link(grids);

... in your form's initialisation process.

(Note: I haven't tried this, just going on the documentation.)

Ed: I tried, and you do have to have the lists as type MyGrid, not DataGridView. So you will have to make the controls on your form MyGrids, too. Also, you might want to handle DataGridView.Scroll as well as the scrollbar's Scroll; I'm not sure when each one gets fired.
GeneralRe: Linking the scroll bars of two controls Pin
Dewald16-Aug-11 22:30
Dewald16-Aug-11 22:30 
GeneralRe: Linking the scroll bars of two controls Pin
BobJanova17-Aug-11 0:03
BobJanova17-Aug-11 0:03 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald17-Aug-11 0:34
Dewald17-Aug-11 0:34 
GeneralRe: Linking the scroll bars of two controls Pin
BobJanova17-Aug-11 3:11
BobJanova17-Aug-11 3:11 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald17-Aug-11 4:00
Dewald17-Aug-11 4:00 
Questionhow to send file from Windows-CE to PC Through Socket Pin
goldsoft16-Aug-11 2:55
goldsoft16-Aug-11 2:55 
AnswerRe: how to send file from Windows-CE to PC Through Socket Pin
BobJanova16-Aug-11 4:36
BobJanova16-Aug-11 4:36 
QuestionAccessing dataset throughout application. Pin
paper6716-Aug-11 2:48
paper6716-Aug-11 2:48 
AnswerRe: Accessing dataset throughout application. Pin
BobJanova16-Aug-11 4:34
BobJanova16-Aug-11 4:34 
QuestionLucene.Net:Using Whitespace analyser wildcardquery is not working Pin
NarVish16-Aug-11 1:47
NarVish16-Aug-11 1:47 
AnswerRe: Lucene.Net:Using Whitespace analyser wildcardquery is not working Pin
Mehdi Gholam6-Sep-11 17:53
Mehdi Gholam6-Sep-11 17:53 
QuestionBoolean conversion Pin
5fingers16-Aug-11 0:28
5fingers16-Aug-11 0:28 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 1:11
mveRichard MacCutchan16-Aug-11 1:11 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 1:23
5fingers16-Aug-11 1:23 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 5:42
mveRichard MacCutchan16-Aug-11 5:42 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 19:38
5fingers16-Aug-11 19:38 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 22:22
mveRichard MacCutchan16-Aug-11 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.