|
적용될려면 ComboBox가 있는 셀들이 편집가능상태여야 합니다.
Option에서 goEditing을 true로 바꾸고 3,1 셀을 더블클릭 해보세요.
일단 Form Create 부분에 아래 코드 넣으시던지 Option에서 바꾸시든 편한대로 하시면 됩니다.
AdvStringGrid1->Options << goEditing;
아래코드는 콤보박스에 아이템 추가하는 겁니다.
void __fastcall TForm1::AdvStringGrid1GetEditorType(TObject *Sender, int ACol,
int ARow, TEditorType &AEditor)
{
if(ACol == 3 && ARow!=0)
AEditor= edComboList;
AdvStringGrid1->Combobox->Items->Clear();
if(ARow==1)
AdvStringGrid1->Combobox->Items->Add("aaa");
if(ARow==2)
AdvStringGrid1->Combobox->Items->Add("bbb");
if(ARow==3)
AdvStringGrid1->Combobox->Items->Add("ccc");
}
마지막으로 TMS HomePage에 델파이로 되어 있지만, TAdvStringGrid에 대한 예제가 나와 있습니다.
ComboBox에 대한건 5번 예제네요.
왼쪽에서 TAdvStringGrid 선택하시면 페이지 마지막 부분에 있습니다.
그럼 즐프 하세요..
example application 1 : printing with TAdvStringGrid
example application 2 : setting colors with TAdvStringGrid (see also sample app 51)
example application 3 : navigation in TAdvStringGrid
example application 4 : general demo of TAdvStringGrid
example application 5 : comboboxes, lookupediting & imagelist images in TAdvStringGrid.
example application 6 : sorting, including custom sorting in TAdvStringGrid
example application 7 : C++Builder demo showing setting of cell color, alignment and sorting styles.
example application 8 : rich text capabilities in TAdvStringGrid
example application 9 : using bitmaps for printing headers & footers
example application 10 : demonstration of some new features
example application 11 : node expand / contract functions
example application 12 : radiobutton inplace editors
example application 13 : combining the versatility of TAdvStringGrid and TWebData to build a stock quote downloader.
example application 14 : demonstrating the TAdvStringGrid grouping features
example application 15 : rich text drag & drop, printing and enhanced row and column moving
example application 16 : using the printsettings dialog & print preview dialog
example application 17 : load a MS Access table into TAdvStringGrid through ADO
example application 18 : using custom sort sequences
example application 19 : using the new edUnitEditBtn for split physical value editing in C++Builder
example application 20 : using the new HTML formatting capabilities
example application 21 : C++Builder version of the main demo
example application 22 : using the new filtering capabilities
example application 23 : an image catalogue program exploring the new support for TPicture in cells
example application 24 : using other TMS edit controls as inplace editors in TAdvStringGrid
example application 25 : printing multiple grids on a single page
example application 26 : using the ESBPCS edit controls as inplace editors in TAdvStringGrid
example application 27 : using the JPMOPen font and color combobox as inplace editors in TAdvStringGrid
example application 28 : using row, cell, cell ranges and column drag & drop
example application 29 : adding a field chooser to TAdvStringGrid
example application 30 : using an inplace rich editor in TAdvStringGrid
example application 31 : using TAdvStringGrid with TChartLink
example application 32 : using the TImagePicker as inplace editor for TAdvStringGrid
example application 33 : a scriptable grid : TGridScript unleashes the power of TatPascalScripter for TAdvStringGrid
example application 34 : using Addict Spell Checker with TAdvStringGrid
example application 35 : using a ColumnComboBox as inplace editor
example application 36 : using the new ControlLook property to select different inplace editor control looks
example application 37 : sorting on selected fixed rows of choice
example application 38 : grouping and merged group headers in TAdvStringGrid
example application 39 : merged cell access, merge cell printing and HTML export
example application 40 : sort independent cell access
example application 41 : virtual cells and disjunct row selection
example application 42 : merged cell printing
example application 43 : advanced border control
example application 44 : floating footer usage
example application 45 : virtual cell sorting
example application 46 : various new TAdvStringGrid features
example application 47 : using the new capability to load data from MDB files
example application 48 : disjunct cell selection
example application 49 : automatically calculating fixed floating footer cells
example application 50 : (ab)using TAdvStringGrid : console app based sorting & fileformat conversion
example application 51 : cell property access, clipboard persistent cell properties and binary save
example application 52 : custom drawing and custom drawing printing support
example application 53 : inplace memo and popup memo editor
example application 54 : using mini HTML forms in TAdvStringGrid cells
example application 55 : almost codeless interface to use any TWinControl as inplace editor for TAdvStringGrid
example application 56 : using the new TAdvGridExcelIO for reading / writing Excel files directly with TAdvStringGrid
example application 57 : using cell controls to show a grid inside a grid
example application 58 : using TAdvGridWorkbook
example application 59 : using TAdvGridWorkbook with the new TAdvGridExcelIO to load/save multisheet XLS files
example application 60 : using data-dependent images
example application 61 : some combobox tricks with TAdvStringGrid
example application 62 : checkbox-based disjunct row selection
example application 63 : subgrouping with TAdvStringGrid
example application 64 : using TAdvGridRTFIO for native RTF export
example application 65 : using TAdvGridCSVPager for using large CSV files with paging
example application 66 : using OnPrintNewPage to start a new page for new data in a column
example application 67 : using the Unicode features of TAdvStringGrid
개발자되기 님이 쓰신 글 :
: 우선 답변해주신거 정말 감사드립니다..
: 몇가지 더 궁금한 점이 있어서요..
:
: 알려주신대로 해봤는데 화면에 아무런 변화가 없구요.. 값을 안줘서 그런지...
: 콤보 박스에 선택 항목들은 어떻게 주는지요? 그리고 이벤트는 어떻게 처리 해야 되는 건지도.. 혹시 아시면.. 도움 부탁드립니다..
:
: void __fastcall TForm1::AdvStringGrid1GetEditorType(TObject *Sender,
: int ACol, int ARow, TEditorType &AEditor)
: {
: if((ACol > 5 && ACol <15) && ARow==0)
: AEditor= edDateEdit;
: if(ACol == 3 && ARow!=0)
: AEditor= edComboList;
: }
:
: 답변해주신거 정말 감사 드려요...
:
: zepirox 님이 쓰신 글 :
: : 안녕하세요.
: : TAdvStringGrid를 아래와 같이 하실려면...
: : GetEditorType 이벤트에 아래와 같은 방법으로 하시면 됩니다.
: : 아래 예는 Col이 5와 15사이에 있는 Row가 0인 셀들에 DateEdit 를 넣는 방법입니다.
: :
: : void __fastcall TMainForm::ExampleGridGetEditorType(
: : TObject *Sender, int ACol, int ARow, TEditorType &AEditor)
: : {
: : if((ACol > 5 && ACol <15) && ARow==0)
: : AEditor= edDateEdit;
: : }
: : 콤보박스는 아래의 값중에서 콤보박스에 해당하는 값을 AEditor에 적용시켜 주시면 되겠네요.
: : 버튼도 마찬가지구요.
: : enum TEditorType { edNormal, edSpinEdit, edComboEdit, edComboList, edEditBtn, edCheckBox, edDateEdit, edDateEditUpDown, edTimeEdit, edButton, edDataCheckBox, edNumeric, edPositiveNumeric, edFloat, edCapital, edMixedCase, edPassword, edUnitEditBtn, edLowerCase, edUpperCase, edFloatSpinEdit, edTimeSpinEdit, edDateSpinEdit, edNumericEditBtn, edFloatEditBtn, edCustom, edRichEdit, edNone, edUniEdit, edUniComboEdit, edUniComboList, edUniEditBtn, edUniMemo };
: :
: : 버튼은 메소드로 바로 제공이 되네요.
: :
: : AddButton 메소드의 파라미터는
: : void __fastcall AddButton(int ACol, int ARow, int bw, int bh, AnsiString Caption, TCellHAlign hal, TCellVAlign val);
: : 입니다.
: :
: : ExampleGrid->AddButton(3,1,40,20,"",haFull,vaFull); <= 이건 3,1에 버튼 추가하라는 말이겠네요.
: :
: :
: :
: : 개발자되기 님이 쓰신 글 :
: : : Q&A 다 뒤지 보고 TMS 홈피도 가봤는데 사용법이 없어서 처음으로 포럼에 글을 씁니다.
: : :
: : : ---------------------------------------------------------------------------------
: : : 이름 | | 학교 | | 학년 |
: : : ---------------------------------------------------------------------------------
: : : | | 콤보 박스 | | 콤보 박스 | 버튼
: : : ---------------------------------------------------------------------------------
: : : | | 콤보 박스 | | 콤보 박스 | 버튼
: : : ---------------------------------------------------------------------------------
: : : | | 콤보 박스 | | 콤보 박스 | 버튼
: : : ---------------------------------------------------------------------------------
: : : | | 콤보 박스 | | 콤보 박스 | 버튼
: : : ---------------------------------------------------------------------------------
: : :
: : : 이런 형태의 Grid가 생성되어야 합니다.
: : : 너무 급해서 여러분들의 도움을 구합니다.. 아시는 분 계시면 간단한 소스 정도만 이라도.. ㅜㅜ
: : :
: : : 꼭 부탁 드려요..
|