473,511 Members | 15,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to auto scroll a datagrid?

Hi,

I have a datagrid (rather a dataset I guess) that I update with
addStatusRow ( ... ). It basically is a Status that adds lines as
something occurs in my thread. As lines are entered, when it gets to
the bottom of the grid, I would like it to automatically scroll, so
the user does not need to use the scroll bar.

Is this easily done?

I have the code:

dsStatus1.Status.AddStatusRow(ibrFixSession.Status ,
System.DateTime.Now.ToLongDateString() + " " +
System.DateTime.Now.ToLongTimeString());

AddToLog(ibrFixSession.Status);

dataGridSessionFix.CurrentRowIndex =
dsStatus1.Status.Rows.Count;

I was hoping that the last line will scroll my datagrid to the last
record, but does not work. The dsStatus1 is bound to the grid. It
is the dsStatus1 that has the rows added. Any ideas if or how I
could get this to work?

Thanks!
Nov 26 '07 #1
3 2534
Hi Soulless (is this your real name?),

if something has a scrollbar, then you can send a
Message to it to make it scroll. See here Messages
and Notifications section for more information. Once
again: If someting has a scrollbar, it can be scrolled
with the windows api and in our case with pinvoking
of the native windows functions like SendMessage
and the Scrollbar Functions:

[Scroll Bar]
http://msdn2.microsoft.com/en-us/library/bb787529.aspx

Hope this helps,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Nov 26 '07 #2
On Nov 26, 4:43 pm, "Kerem Gümrükcü" <kareem...@hotmail.comwrote:
Hi Soulless (is this your real name?),

if something has a scrollbar, then you can send a
Message to it to make it scroll. See here Messages
and Notifications section for more information. Once
again: If someting has a scrollbar, it can be scrolled
with the windows api and in our case with pinvoking
of the native windows functions like SendMessage
and the Scrollbar Functions:

[Scroll Bar]http://msdn2.microsoft.com/en-us/library/bb787529.aspx

Hope this helps,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:http://kerem-g.spaces.live.com/
Latest Open-Source Projects:http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Hey, Thanks!!!
Nov 28 '07 #3
Dude, you are welcome,...
Sign my guestbook if you like, i need entries, its new :-)

http://entwicklung.junetz.de/guestbook
Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Nov 28 '07 #4

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

Similar topics

4
5897
by: Bill Sonia | last post by:
It seems whenever I set a DataGrid.DataSource = DataTable (vb.net) to populate a datagrid, the scroll bars on the datagrid default to disabled. And the only way I can get them to enable is to...
2
7504
by: Boaz Ben-Porat | last post by:
Hi all Is there a way to simulate a click on a scrollbar (horizontal) of a FataGrid ? I need to programmatically scroll the grid to the right/left upon some condition, when the total width of...
0
2630
by: Alex Moskalyuk | last post by:
I am using System.Windows.Forms.TextBox to publish some real-time data that's coming off the external devices. My data is fed into the TextBox with proper precautions not to exceed the MaxSize...
1
1880
by: Gidi | last post by:
hello i have a DataGrid table and by the help of Adnan, here in the forum, i have the Mouse_up Event that by Clicking a row on the dataGrid it's selectes the whole ro the problem is when i'm...
0
2219
by: 23s | last post by:
Is there any way I can send a vertical value to a form's scroll position? I have a full-screen form that, at launch, contains an empty tab sheet. At run time, the user can dynamically append a...
2
2768
by: Grant Smith | last post by:
I am currently trying to expand upon the default datagrid control using VB.NET. I have noticed one quirk about it that I cna't seem to get around. If I have a datagrid that doesn't display all of...
0
1505
by: Greg | last post by:
I've made a datagrid multiline (for anyone interested, I used an adaptation of the code at http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp). This has introduced a very serious issue: the vertical...
4
12499
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0'...
1
5144
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
0
7137
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...
0
7349
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,...
0
7417
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...
1
7074
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...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
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 ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.