Delphi7中有没可以直接在cell中输入数据的gird控件?在那个页签下啊?

解决方案 »

  1.   

    把DBGRID改成可写就行了啊,不知道你需要的是什么
      

  2.   

    我想要的是將gird控件中自由控制部分控件和編輯,部分不可編輯,我了解到有stringgrid,datagrid,drawgird,不知道哪個好~
      

  3.   

    看一下cxGrid可否满足你的需要。
      

  4.   

    cxgird在哪個頁簽下面啊,哪個有這幾個gird控件的使用大全嗎?指點一下小弟不甚感謝
      

  5.   

    stringgrid 比较好控制~
    F1Book 没用过..看上去不错..我一般都用TMS AdvStringGrid
      

  6.   

    datagrid 足够了,TColumn.ReadOnly可以控制其是否只读。  {表字段字典}
      PDicField=^TDicField;
      TDicField=record
    code     : string;    {表代码}
        id  : integer;   {序号}
        name     : string;    {字段名称}
        cName    : string;    {中文名称}
        sName  : string;    {显示名称}
        constant : string;    {字段常量}
        userType : char;      {字段用户类型}
        isShow  : boolean;   {是否显示}
        showBlock: string;    {显示控制块}
        format   : string;    {显示格式}
        width    : integer;   {宽度}
        uiType   : char;      {界面表现形式}
        ctrl     : smallint;  {控制字}
        query  : boolean;   {是否可作为查询条件}
      end;
      {字段列表--------------------------------------------------------------------}
      TDicFieldList=record
       nFields: integer;
        fields : array of TDicField;
      end;//动态生成DBGrid表头,生成的表头来自字典。
    //动态生成时,可控制各列的表现形式,如下拉框、按钮,并且可控制读/写属性
    procedure G_BuildDBGridHead(const DBGrid: TDBGrid; DicFields: TDicFieldList);
    var
      i: Integer;
      ValueLst: TStrings;
      newColumn: TColumn;
    begin
      DBGrid.Columns.Clear;
      for i:=0 to DicFields.nFields-1 do
      begin
       if not DicFields.Fields[i].isShow then Continue;
        newColumn := DBGrid.Columns.Add;
        newColumn.Title.Alignment := taCenter;
        newColumn.Title.Caption := DicFields.Fields[i].sName;
        newColumn.FieldName := DicFields.Fields[i].name;
        newColumn.Width := DicFields.Fields[i].width;    case DicFields.Fields[i].uiType of
         'C':begin
                ValueLst := TStringList.Create;
                G_SeperateString(DicFields.Fields[i].constant,ValueLst);
                newColumn.PickList.AddStrings(ValueLst);
                newColumn.DropDownRows := 20;
                ValueLst.Free;
                newColumn.Color := clCream;
                newColumn.ButtonStyle := TColumnButtonStyle(cbsAuto);
             end;
          'B':NewColumn.ButtonStyle := TColumnButtonStyle(cbsEllipsis);
        end;
        newColumn.ReadOnly := DicFields.fields[i].ctrl<3;
        if newColumn.ReadOnly then newColumn.Color := clReadOnly;
      end;
      if DBGrid.ReadOnly then DBGrid.Options := DBGrid.Options+[dgRowSelect];
    end;