Board index » delphi » Scrolling DBGrid columns

Scrolling DBGrid columns

Hi everybody.

I have a DBGrid which a great number of columns. The DBGrid has got
dgEditing = False and gdRowSelect = True.

I want to scroll columns programmatically, for example when user press a key.

I haven't found a property or method to do this.

Do you know how to make this ? Or do you know a third-party grid that can
scroll columns ?

Thanks in advice

  Giuseppe Garzotto
  doubl...@goldnet.it
  http://www.geocities.com/SiliconValley/9183

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:Scrolling DBGrid columns


You mean scroll left-right?
Just send a scroll message to grid in Onkeydown:
procedure TFormBlabla.DBGrid1KeyDown(Sender.....);
begin
case Key of
  VK_Left: DBGrid1.Perform(WM_HScroll,SB_PageUp,0);
  VK_Right: DBGrid1.Perform(WM_HScroll,SB_PageDown,0);
end;
end;

You can use SB_LineUp/Down scroll commands depending on what behaviour you
want.

--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.qwe.ce...@neosys.xrs.qwe.si

No questions via email, unless explicitly invited.

Quote
doubl...@goldnet.it wrote in message <7bguju$s7...@nnrp1.dejanews.com>...
>Hi everybody.

>I have a DBGrid which a great number of columns. The DBGrid has got
>dgEditing = False and gdRowSelect = True.

>I want to scroll columns programmatically, for example when user press a
key.

>I haven't found a property or method to do this.

>Do you know how to make this ? Or do you know a third-party grid that can
>scroll columns ?

>Thanks in advice

>  Giuseppe Garzotto
>  doubl...@goldnet.it
>  http://www.geocities.com/SiliconValley/9183

>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Re:Scrolling DBGrid columns


Hi there,

check the .LeftCol property...

--
Martijn Tonies

<- remove some characters from my email adress to reply ->
m.ton...@somecharacters.upscene.demon.nl
http://www.upscene.demon.nl

doubl...@goldnet.it heeft geschreven in bericht
<7bguju$s7...@nnrp1.dejanews.com>...

Quote
>Hi everybody.

>I have a DBGrid which a great number of columns. The DBGrid has got
>dgEditing = False and gdRowSelect = True.

>I want to scroll columns programmatically, for example when user press a
key.

>I haven't found a property or method to do this.

>Do you know how to make this ? Or do you know a third-party grid that can
>scroll columns ?

>Thanks in advice

>  Giuseppe Garzotto
>  doubl...@goldnet.it
>  http://www.geocities.com/SiliconValley/9183

>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Other Threads