Re: How to change row colour
Posted by: Jose Vazquez
Date: June 03, 2005 02:38AM

Hi there,

I am also developing in Borland C++, have you experienced a problem when using DBEDIT with a database textfield?. I cannot make my application work with a dbedit because it shows (memo) when I use a vachar(16) only the first time and when I try to insert something through the dbedit it will show an error saying "cannot access my_field as type text". The thing is that when I insert with a sql sentence it will allow me to do any insertion or deletion afterwards without any problem.

I have found a way of changing the odd color rows I bet that if you use the command FOCUSED you will get what you want.

here it goes:

void __fastcall TForm6::DBGrid1DrawColumnCell(TObject *Sender, <------ DBGRID EVENT
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
if(!DataSource2->DataSet->IsEmpty())
{

if(DataSource2->DataSet->RecNo % 2!=0)
{
DBGrid1->Canvas->Brush->Color=clGradientInactiveCaption;
DBGrid1->DefaultDrawColumnCell(Rect, DataCol, Column, State);
}
}
}

Options: ReplyQuote


Subject
Views
Written By
Posted
878
May 02, 2005 11:36PM
Re: How to change row colour
891
June 03, 2005 02:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.