본문 바로가기

Delphi Tip/그리드18

퀀텀 그리드 컬럼 동적 생성 퀀텀 그리드 컬럼 동적 생성   procedure Form.CreateGridFields(const tvCaption, tvFieldName, tvProperties: string; tvMerging, tvalign: boolean; tvWidth: integer); begin  with tv.CreateColumn do  begin    Caption := tvCaption;    DataBinding.FieldName := tvFieldName;     HeaderAlignmentHorz := taCenter;     HeaderAlignmentVert := vaCenter;     Name := 'tv' + tvFieldName;     Options.CellMerging := tvMerging; .. 2024. 5. 3.
StringGrid Row색칠/정렬 하기 StringGrid Row색칠/정렬 하기 procedure Tfrm_xxx.Grid_ListDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Ls_mt_kbn : String; LeftPos: Integer; TopPos : integer; CellStr: string; begin Ls_mt_kbn := Grid_List.Cells[16,ARow]; if (ACol >= Grid_List.FixedCols) and (ARow >= Grid_List.FixedRows) then with Grid_List.Canvas do begin if Ls_mt_kbn = 'M' then Brush.Color :=.. 2024. 4. 15.
델파이 퀀텀 그리드 헤더 색깔 변경 델파이 퀀텀 그리드 헤더 색깔 변경 1. 설정 변경 cxGrid1.LookAndFeel.NativeStyle := False; cxGrid1.LookAndFeel.SkinName := ''; 프로퍼티 False 처리 2.코딩 procedure .CustomDrawColumnHeader( Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean); begin ... ACanvas.FillRect(AViewInfo.Bounds, clLime); ACanvas.FrameRect(AViewInfo.Bounds, clBlack, 1, cxBordersAll); ACanvas.DrawT.. 2021. 9. 24.
StringGrid 팁 StringGrid 팁 property colcount-유동셀 가로 셀의 갯수 rowcount-유동셀 세로 셀의 갯수 fixedrows-고정셀의 가로 갯수 fixedcols-고정셀의 세로 갯수 color-stringgrid의 유동셀배경색 fixedcolor-striggrid의 고정셀배경색 defaultcolwidth-셀의가로크기 defailtrowheight-셀의세로크기 gridlinewidth-grid선의 굵기 scrollbars-스크롤노출여부(ssboth:가로,세로) option-여러가지 설정을 합니다. goEdition(입력가능하게) goTabs(탭키로 셀간 이동할수있게) event DrawCell-데이터가 각 셀에 그려질때 발생하는 이벤트 selectcell-셀을 선택시 발생하는 이벤트 ex)Sh.. 2021. 9. 23.
델파이 퀀텀그리드 출력 리스트 읽기 델파이 퀀텀그리드 출력 리스트 읽기 cxGrid1.ViewData.DataController.DisplayTexts[RowCount,컬럼번호] 2021. 9. 17.
델파이 스트링그리드(StringGrid) 셀 정렬하기 델파이 스트링그리드(StringGrid) 셀 정렬하기 스트링그리드의 셀을 원하시는 데로 정렬하실 수 있습니다. 스트링그리드의 OnDrawCell 이벤트를 원하시는 정렬방식으로 코딩해 주세요. // *********************************************************************** // 왼쪽 정렬 ************************************************************* // *********************************************************************** procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Inte.. 2021. 9. 16.
델파이 advStringGrid 가운데 정렬 델파이 advStringGrid 가운데 정렬 StringGrid1.DefaultAlignment := taCenter 2021. 9. 15.
StringGrid 초기화 StringGrid 초기화 procedure TF_Item_Save.StringGridClear; var I: Integer; begin for I := 0 to StringGrid.ColCount - 1 do StringGrid.Cols[I].Clear; StringGrid.RowCount := 2; StringGrid.Cells[0,0] := '대분류'; StringGrid.Cells[1,0] := '중분류'; StringGrid.Cells[2,0] := '시약및재료명'; StringGrid.Cells[3,0] := '규격'; StringGrid.Cells[4,0] := '단위'; StringGrid.Cells[5,0] := '저장여부'; end; 2021. 9. 14.
델파이 퀀텀그리드 Multi select 된 Row값 가져오기 델파이 퀀텀그리드 Multi select 된 Row값 가져오기 for I := 0 to grdItemDBTableView1.Controller.SelectedRowCount -1 do begin qryTemp.Close; qryTemp.SQL.Clear; qryTemp.SQL.Add('Delete from mst_item where rowid = '+grdItemDBTableView1.Controller.SelectedRows[i].Values[0]+' '); qryTemp.ExecSQL; end; 2021. 9. 13.
델파이 스트링그리드 삭제/삽입 델파이 스트링그리드 삭제/삽입 // 줄 삭제 procedure StringGridDeleteRow(StringGrid: TStringGrid; Position: integer); var i: integer; begin for i := Position to StringGrid.RowCount - 1 do StringGrid.Rows[i] := StringGrid.Rows[i + 1]; StringGrid.RowCount := StringGrid.RowCount - 1; end; // 줄 삽입 procedure StringGridInsertRow(StringGrid: TStringGrid; Position: integer); var i: integer; begin StringGrid.RowCount := S.. 2021. 9. 9.
델파이 퀀텀그리드 마지막데이터 선택 델파이 퀀텀그리드 마지막데이터 선택 cxGridDBTableView6.DataController.FocusedRecordIndex := cxGridDBTableView6.DataController.RecordCount-1; 2021. 9. 7.
델파이 AdvStringGrid에서 MultiSelect 델파이 AdvStringGrid에서 MultiSelect 1. option -> RangceSelct = > True 2. MouseAction = > DisjuntCellSelect =>True 2021. 9. 6.
Delphi 스트링그리드(StringGrid) 정렬 Delphi 스트링그리드(StringGrid) 정렬 스트링그리드 컬럼을 선택하면 해당 컬럼으로 정렬됩니다. { ************** SortGrid ************* } procedure TForm1.SortGrid(Grid: TStringGrid; SortCol: Integer); { A simple exchange sort of grid rows } var I, J: Integer; temp: TStringList; begin temp := TStringList.create; with Grid do for I := FixedRows to RowCount - 2 do { because last row has no next row } for J := I + 1 to RowCount - 1 d.. 2021. 9. 3.
델파이 Tcxgrid 선택한 값 가져오기 델파이 Tcxgrid 선택한 값 가져오기 var i : Integer; vVal : Variant; begin //with cxGridDBTableView16 do //begin // ShowMessage(Columns[Controller.FocusedColumnIndex].Caption); // ShowMessage(Columns[Controller.SelectedColumns[4]].Caption); //end; //cxGridDBTableView16.DataController.SelectRows(4); vVal := Null; for I := 0 to cxGridDBTableView16.DataController.GetSelectedCount-1 do begin vVal := cxGridDBTabl.. 2021. 9. 1.
델파이 퀀텀그리드 Excel출력하기 델파이 퀀텀그리드 Excel출력하기 1. uses 절에 다음을 추가 한다 cxGridExportLink , shellApi 2. 엑셀버튼 클릭시 SaveDialog1.FileName := '상품코드.xls'; if SaveDialog1.Execute then begin ExportGridToExcel(SaveDialog1.FileName, Grid_Master, true, true, false, 'xls'); Application.ProcessMessages; if MessageDlg(SaveDialog1.FileName + ' 파일을 실행하시겠습니까?', mtWarning, [mbYes, mbNo], 0) = mrYes then ShellExecute(self.Handle, PChar('OPEN'), .. 2021. 8. 31.
델파이 TcxDBTreeList 북마크 Bookmarks 사용하기 델파이 TcxDBTreeList 북마크 사용하기 억지스럽지만.....모...; procedure DBTreeListSelectBookmark_Go(DBTreeLiat:TcxDBTreeList; iFocus, iFocus0,iFocus1,iFocus2,iFocus3: integer ); begin case iFocus of 0 : DBTreeLiat.Items[iFocus0].Focused := True; 1 : DBTreeLiat.Items[iFocus0].Items[iFocus1].Focused := True; 2 : DBTreeLiat.Items[iFocus0].Items[iFocus1].Items[iFocus2].Focused := True; 3 : DBTreeLiat.Items[iFocus0].I.. 2021. 8. 27.
델파이 퀀텀트리리스트 TcxDbTreeList 멀티셀렉트 데이터 키값가져오기 델파이 퀀텀트리리스트 TcxDbTreeList 멀티셀렉트 데이터 키값가져오기 procedure TForm1.Button1Click(Sender: TObject); Var i: integer; begin for I := 0 to cxDBTreeList1.SelectionCount - 1 do Memo1.lines.add(TcxDBTreeListNode(cxDBTreeList1.Selections[i]).KeyValue); end; procedure TForm1.Button1Click(Sender: TObject); Var i: integer; begin cxDBTreeList1.DataController.BeginUpdate; try for I := 0 to cxDBTreeList1.SelectionCou.. 2021. 8. 26.
delphi tadvcolumngrid fixedcolor delphi tadvcolumngrid fixedcolor grid.Look을 glStandard로 설정하고 grid.FixedColor를 사용할 수도 있습니다. 2021. 8. 25.