dbgird combobox width problem

From: ganesh (gsganesh_at_yahoo.com)
Date: 12/02/03


Date: 2 Dec 2003 01:29:49 -0700


I've a combobox in dbgrid, when i increase the column width on runtime then
combobox also increase, but if i decrease the column width combobox is not resizing

what could be the problem

here my code

procedure TfrmDesignerExport.grdProjectDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
begin
  if (EditMode in [dsEdit, dsInsert]) then
  begin
     if (gdFocused in State) and (Column.Field.FieldName = 'FieldName') then
     begin
       cbSystemFields.Left := Rect.Left + grdProject.Left + 1;
       cbSystemFields.Top := Rect.Top + grdProject.top + 1;
       cbSystemFields.Width := Rect.Right - Rect.Left + 1;
       cbSystemFields.Height := Rect.Bottom - Rect.Top;
       cbSystemFields.Visible := True;
       cbSystemFields.Text := Column.Field.AsString;
     end;
  end;

end;
{------------------------------------------------------------------------------}

Thanks



Relevant Pages

  • Re: Questions on combo box and MSFlexGrid
    ... When the users choose a fieldname in combobox, ... Use a databound control -- DBCombo and DBGrid, ... I think that most people's objection to DBGrid is for data entry. ...
    (microsoft.public.vb.database)
  • Re: Questions on combo box and MSFlexGrid
    ... I will take a look at the DBGRID and DBCombo and give them a try. ... When the users choose a fieldname in combobox, ... Use a databound control -- DBCombo and DBGrid, ... I think that most people's objection to DBGrid is for data entry. ...
    (microsoft.public.vb.database)