Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2000, 09:37 PM
N/A
Guest
 
Posts: n/a
Default Need a little DBGrid help

I have a DBGrid that I need to eliminate the highlight from when an individual cell is being edited. The grid is black and the font is a custom yellow. Looks ugly but that is what the user asked for. Anyway, I have the following code in the program and it works fine but when I start to type new data in a cell it highlights white until you exit the cell. I need to get rid of the white highlight. Can anyone tell me what I am doing wrong or what I am forgetting to do? Thanks in advance.

Rich

procedure TForm1.DBGrid1DrawColumnCell (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if gdFocused in State then
begin
DBGrid1.Canvas.Brush.Color:=clBlack;
DBGrid1.Canvas.Font.Color:=$0080FFFF;
end
else if gdSelected in State then
begin
DBGrid1.Canvas.Brush.Color:=clBlack;
DBGrid1.Canvas.Font.Color:=$0080FFFF;
end
else if gdFixed in State then
begin
DBGrid1.Canvas.Brush.Color:=clBlack;
DBGrid1.Canvas.Font.Color:=$0080FFFF;
end
else
begin
DBGrid1.Canvas.Brush.Color:=clBlack;
DBGrid1.Canvas.Font.Color:=$0080FFFF;
end;
DBGrid1.Canvas.FillRect(Rect);
DBGrid1.DefaultDrawDataCell(Rect,
Column.Field, State);
end;
Reply With Quote
  #2  
Old 10-02-2000, 06:43 AM
N/A
Guest
 
Posts: n/a
Default RE: Need a little DBGrid help

The white "highlight" is actually the InPlace editor's background.

You will have to override the painting of the
IPE in order to do this...
Reply With Quote
  #3  
Old 10-03-2000, 07:33 PM
N/A
Guest
 
Posts: n/a
Default RE: RE: Need a little DBGrid help

Thanks...that worked great
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.