Jump to content
Sign in to follow this  
Henry Olive

ClientDataSet Grouping

Recommended Posts

I wish everyone a healthy day.
In object inspector's IndexDefs i created an index ('ITCDINX') for the CDS

then i set IndexName to ITCDINX and I wrote Fields = (ITEMCODE;SUBITEMCODE) and Grouping Level=1

then in Fields Editor i selected the field  'ITEMCODE' 

in field's OnGetText Event i wrote below code

procedure TForm1.CDS1ITEMCODEGetText(Sender: TField; var Text: string;
  DisplayText: Boolean);
begin
  if gbFirst in CDS1.GetGroupState (1) then
     Text := Sender.AsString else
     Text := '';
end;

 

I dont get any error msg., my query works well

but *all* ITEMCODE's values in DBGrid is empty (No value) 

all the other values are OK.

What am i doing wrong ?

Thank You

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×