The study notes dev controls ---- CxGrid2

A, cxgrid adaptive table and column width and increase Footnote

    for i := 0 to ado_lxr_cx.FieldCount - 1 do
    begin
      //如果是数字,则注脚求合
      if (ADO_lxr_cx.Fields[i] is TNumericField) then
      begin
        cxGrid1DBTableView1.GetColumnByFieldName(ADO_lxr_cx.Fields[i].FieldName).Summary.FooterFormat:='#,0.00';
        cxGrid1DBTableView1.GetColumnByFieldName(ADO_lxr_cx.Fields[i].FieldName).Summary.FooterKind := skSum;
      end ;
      //自适应列宽
      cxGrid1DBTableView1.Columns[i].ApplyBestFit();
    end;

Guess you like

Origin www.cnblogs.com/yclizq/p/11372815.html