PC Review


Reply
Thread Tools Rate Thread

How to auto scroll a datagrid?

 
 
Soulless
Guest
Posts: n/a
 
      26th Nov 2007
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!
 
Reply With Quote
 
 
 
 
Kerem Gümrükcü
Guest
Posts: n/a
 
      26th Nov 2007
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."


 
Reply With Quote
 
Soulless
Guest
Posts: n/a
 
      28th Nov 2007
On Nov 26, 4:43 pm, "Kerem Gümrükcü" <kareem...@hotmail.com> wrote:
> 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!!!
 
Reply With Quote
 
Kerem Gümrükcü
Guest
Posts: n/a
 
      28th Nov 2007
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."


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to scroll two datagrid with one scroll bar newbie Microsoft C# .NET 0 8th Jan 2007 06:20 PM
Scroll bar in datagrid =?Utf-8?B?UmVzaG1hIFByYWJodQ==?= Microsoft C# .NET 1 12th Aug 2004 01:54 PM
DataGrid Scroll James Microsoft C# .NET 0 28th Jun 2004 07:27 AM
Textbox auto-scroll doesn't always auto-scroll Alex Moskalyuk Microsoft C# .NET 0 6th May 2004 06:47 PM
Datagrid- scroll sumit Microsoft ASP .NET 4 17th Nov 2003 04:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 PM.