473,609 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with scrolling two DataGrids at the same time... CODE INCLUDED!

I'm having trouble scrolling some datagrids so they sync up...

I have two identical datagrids on a form, filled with eh same dataset. I want a user to be able to scroll on the datasets and the
other dataset then scrolls to the same place on the other dataset (bare with me). This is the code that I have so far...

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
SqlDataAdapter1 .Fill(IssueData set1)
For Each acontrol As Control In DataGrid1.Contr ols
If acontrol.GetTyp e() Is GetType(VScroll Bar) Then
AddHandler CType(acontrol, VScrollBar).Scr oll, AddressOf vertChange
Exit For
End If
Next
End Sub

Private Sub vertChange(ByVa l sender As Object, ByVal e As ScrollEventArgs )
Static Dim Value As Integer = 0

Dim hHScroll As IntPtr = FindWindowEx(Da taGrid2.Handle, New IntPtr(0), "WindowsForms10 .SCROLLBAR.app3 ", Nothing)
Dim hVScroll As IntPtr = FindWindowEx(Da taGrid2.Handle, hHScroll, "WindowsForms10 .SCROLLBAR.app3 ", Nothing)

If e.NewValue > Value Then
SendMessage(Dat aGrid2.Handle, MsgType.WM_VSCR OLL, CType(MsgType.S B_PAGERIGHT, Integer), hVScroll.ToInt3 2)
Else
SendMessage(Dat aGrid2.Handle, MsgType.WM_VSCR OLL, CType(MsgType.S B_PAGELEFT, Integer), hVScroll.ToInt3 2)
End If

Value = e.NewValue

End Sub

I can get the datagrids to move together, but they don't always end up on the same line as each other. Anyone have any code to fix
this?

Thanks a bunch!

Scott
Nov 20 '05 #1
0 1252

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1606
by: João Santa Bárbara | last post by:
Hi all i have a datatable with 2500 records, and i want to fill a listview, my problem is that it take too much time to load them all. is anytihing i could do to improve my performançe..... ???? it take about 45 seconds with 2500, i need to put at least 10000 in few seconds ... :( See my code below perhaps you can help ..
3
1762
by: P Wolpert | last post by:
This is my first post. I hope I don't sound stupid. I have a script conflict when I put two scripts on one page. Both scripts will work if I use one at a time but the menu button script will not work when I add the scrolling text script. One script, the menu button script, has an "Onload" command and the other one does not. From what I know, and that's not much, I need to put both scripts in the "Onload" command. I just don't know how to...
5
4355
by: Bryan Masephol | last post by:
Hi All I got a datagrid and a ComboBox on a form. I populate the combobox with years for all the data avaiable. When the user chooses a year the datagrid is populated with the specific years information. Problem... when the users scrolls the datagrid with the mouse wheel it work for 2 wheel clicks and then for some reason the focus jumps to the combobox and the year is then changes there for causing the data to change and errors...
2
9828
by: PHead | last post by:
Is there any way to stop the console from scrolling? What I mean isnt to not scroll at all, its that I want to get rid of the buffer. When a new line is created, I want row 0 to go away permanently, not just be scrolled out of view. No scroll bars, etc. I know the C# console is weak, but even via Win32 API?
2
2955
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a url page
0
996
by: jonefer | last post by:
I have a page that has some textboxes and datagrids placed on scrolling divs (for display purposes) Is there a quick and dirty way to print text of these scrolling data grids even if it is very rudimentary? For example, the printout will be of a patient (Demographics in textboxes) and allergy lists, problem lists, Immunizations, Benefits lists vertically stacked. The purpose would be just to have a conveniently printed version.
3
2708
by: Brian Tkatch | last post by:
I have a form with two DataGrids, which are kept in sync manually via Stored PROCEDURE calls. That is, when a record is selected on the first grid, a stored PROCEDURE is CALLed to Fill() the next second DataGrid's DataSource. All that works very well. And, when there are no records to display, it is simply left blank. My issue is that when i scroll the first one, sometimes the second grid shows a bunch of null values (a "new" record). ...
0
3186
by: Vinutha | last post by:
I have designed one xhtml page using frameset, where i have included 3 frames to make one page, ie. one for header, one for menuTree & one for body, This is my code, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"...
5
3684
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually for repeated html im using the external js, i mean the TOP, BOTTOM they are repeated in every page, so i include them as functions in the external js and call them. Why it doesn't work?
0
8113
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8051
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8557
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8512
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8203
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5504
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2517
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.