* °³¿ä
Grid, Table ¼¿ÀÇ ÄÄÆ÷³ÍÆ® ŸÀÔ¿¡ ´ëÇÑ ¼³¸íÀÔ´Ï´Ù.
* »ó¼¼ ¼³¸í
1. CellType°ú EditorTypeÀÇ Â÷ÀÌÁ¡
Grid, Table ÄÄÆ÷³ÍÆ®ÀÇ ¼¿Àº ÆíÁý»óÅÂÀÏ ¶§¿Í ÆíÁý»óÅ°¡ ¾Æ´Ñ °æ¿ì °¢°¢ ÄÄÆ÷³ÍÆ®°¡ ´Þ¶óÁý´Ï´Ù.
CellTypeÀº ¼¿ÀÌ ÆíÁý»óÅ°¡ ¾Æ´Ò ¶§ÀÇ ÄÄÆ÷³ÍÆ® ŸÀÔÀÔ´Ï´Ù.
EditorTypeÀº ¼¿ÀÌ ÆíÁý»óÅÂÀÏ ¶§ÀÇ ÄÄÆ÷³ÍÆ® ŸÀÔÀÔ´Ï´Ù.
¼¿ÀÌ ÆíÁý»óÅÂÀÏ ¶§ÀÇ ÄÄÆ÷³ÍÆ®¸¦ EditComponent¶ó°í ÇÕ´Ï´Ù.
2. CellType
¼¿ÀÌ ÆíÁýÁßÀÌ ¾Æ´Ñ °æ¿ì ÄÄÆ÷³ÍÆ® ŸÀÔÀ» ¾Æ·¡ ¼³Á¤°ªÀ¸·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Table ÄÄÆ÷³ÍÆ®´Â Å×ÀÌºí ¸¶¹ý»ç¿¡¼ ¼±ÅÃÇÑ °¢ ÇʵåÀÇ ColumnType ¼Ó¼º¿¡¼ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Grid ÄÄÆ÷³ÍÆ®´Â ½ºÅ©¸³Æ®¿¡¼ ChangeCellTypeInRange ¸Þ¼Òµå·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
¼³Á¤°ª |
¼³¸í |
½ÇÁ¦ ÄÄÆ÷³ÍÆ® |
Button |
¹öÆ° |
GridCellButton |
CheckBox |
üũ¹Ú½º |
GridCellCheckBox |
ComboBox |
ÄÞº¸¹Ú½º |
GridCellCombo |
Custom |
»ç¿ëÀÚÄÁÆ®·Ñ |
GridCellCustom |
GridTreeNode |
±×¸®µåÆ®¸®³ëµå |
GridCellTreeNode |
Label |
¶óº§ |
GridCellLabel |
PictureBox |
ÇÈó¹Ú½º |
GridCellPicture |
RadioButton |
¶óµð¿À¹öÆ° |
GridCellRadioButton |
RichTextBox |
¸®Ä¡ÅؽºÆ®¹Ú½º |
GridCellRichText |
¨ª ½ÇÁ¦ ÄÄÆ÷³ÍÆ®ÀÇ Property¿Í Method¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
¨ª ¼Ó¼º °ª ¼³Á¤Àº ¼Ó¼º âÀ̳ª ½ºÅ©¸³Æ®·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
¨ª Event´Â Áö¿øµÇÁö ¾Ê½À´Ï´Ù.
3. EditorType
¼¿ÀÌ ÆíÁýÁßÀÎ °æ¿ì ÄÄÆ÷³ÍÆ® ŸÀÔÀ» ¾Æ·¡ ¼³Á¤°ªÀ¸·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Table ÄÄÆ÷³ÍÆ®´Â ȸ鿡¼ ¼¿À» ¼±ÅÃÇÑ ÈÄ ¼Ó¼ºÃ¢ÀÇ EditComponent ¼Ó¼º¿¡¼ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Grid ÄÄÆ÷³ÍÆ®´Â ȸ鿡¼ ¼¿À» ¼±ÅÃÇÑ ÈÄ ¼Ó¼ºÃ¢ÀÇ EditComponent ¼Ó¼º¿¡¼ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. Grid´Â ȸ鿡¼ ¼¿ÀÌ Çϳª¸¸ º¸À̱⠶§¹®¿¡ ƯÁ¤ ¼¿¿¡ ´ëÇؼ´Â ½ºÅ©¸³Æ®¿¡¼ ChangeEditorTypeInRange ¸Þ¼Òµå·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
¼³Á¤°ª |
¼³¸í |
½ÇÁ¦ ÄÄÆ÷³ÍÆ® |
None |
¾øÀ½ (±âº» °ª) |
|
TextBox |
ÅؽºÆ®¹Ú½º |
TextBox |
Button |
¹öÆ° |
Button |
CheckBox |
üũ¹Ú½º |
CheckBox |
RadioButton |
¶óµð¿À¹öÆ° |
RadioButton |
ComboBox |
ÄÞº¸¹Ú½º |
ComboBox |
DateTimePicker |
DateTimePicker |
DateTimePicker |
NumericUpDown |
NumericUpDown |
NumericUpDown |
MaskTextBox |
MaskÅؽºÆ®¹Ú½º |
MaskTextBox |
ActiveXControl |
ActiveXÄÁÆ®·Ñ |
ActiveXControl |
RichTextBox |
¸®Ä¡ÅؽºÆ®¹Ú½º |
RichTextBox |
¨ª ½ÇÁ¦ ÄÄÆ÷³ÍÆ®ÀÇ Property¿Í Method, Event¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
¨ª Property¿Í Method, Event ¸ðµÎ ½ºÅ©¸³Æ®·Î ÁöÁ¤ÇÕ´Ï´Ù.
¨ª Event´Â SetEventÇÔ¼ö¸¦ ÀÌ¿ëÇÏ¿© ¼³Á¤ÇÕ´Ï´Ù.
3. EditComponent
EditComponent´Â ¼¿ÀÌ ÆíÁý»óÅ°¡ µÉ ¶§ »ý¼ºµË´Ï´Ù. ¶ÇÇÑ ¸ðµç ¼¿¿¡ ´ëÇؼ EditComponent´Â ¸Þ¸ð¸®»ó¿¡ ½ÇÁ¦ Çϳª¸¸ Á¸ÀçÇÕ´Ï´Ù.
- EditTypeÀÌ ´Þ¶óÁö´Â °æ¿ì ±âÁ¸ EditComponent ¸¦ »èÁ¦ÇÏ°í »õ·Î ¸¸µì´Ï´Ù.
- EditTypeÀÌ °°Àº °æ¿ì ComboBox ŸÀÔÀÌ¸é ±âÁ¸ EditComponent ¸¦ »èÁ¦ÇÏ°í »õ·Î ¸¸µì´Ï´Ù.
- EditTypeÀÌ °°Àº °æ¿ì ComboBox ŸÀÔÀÌ ¾Æ´Ï¸é ±âÁ¸ EditComponent ¸¦ ±×´ë·Î »ç¿ëÇÕ´Ï´Ù. ±âÁ¸ EditComponentÀÇ ¼Ó¼º°ú À̺¥Æ® °ªÀÌ ±×´ë·Î À¯ÁöµË´Ï´Ù.
¿¹¸¦ µé¾î, GridÀÇ (row, col)ÀÌ (0,0) ÀÎ ¼¿ÀÇ EditTypeÀÌ ComboBoxÀÎ °æ¿ì (0,0) ¼¿ÀÌ ÆíÁý»óÅ°¡ µÉ ¶§ ComboBox°¡ ½ÇÁ¦·Î ¸¸µé¾î Áö¸ç, EditTypeÀÌ ComboBox·Î °°Àº ´Ù¸¥ ¼¿ (1, 0)À» ÆíÁýÇÒ ¶§ EditCompont´Â »õ·Î ¸¸µé¾î Áý´Ï´Ù. ¸¸¾à EditTypeÀÌ ´Ù¸¥ ¼¿À» ÆíÁýÇÒ °æ¿ì¿¡µµ ¸Þ¸ð¸®¿¡¼ EditComponent°¡ »èÁ¦µÇ°í »õ·Î ¸¸µé¾î Áý´Ï´Ù. ±×·¯³ª EditTypeÀÌ TextBoxÀÎ ¼¿À» ÆíÁýÇÏ´Ù°¡ EditTypeÀÎ TextBox·Î °°Àº ´Ù¸¥ ¼¿À» ÆíÁýÇÏ°Ô µÇ¸é ±âÁ¸ EditComponentÀÇ ¼Ó¼º°ú À̺¥Æ®°¡ À¯ÁöµÇ¾î ÃʱâÈÇÏÁö ¾ÊÀ¸¸é ¿øÇÏÁö ¾Ê´Â ¼Ó¼ºÀ¸·Î ¼³Á¤µÇ°Å³ª ¿øÇÏÁö ¾Ê´Â À̺¥Æ®°¡ ½ÇÇàµÉ ¼öµµ ÀÖ½À´Ï´Ù.
EditComponentÀÇ À̺¥Æ®´Â Grid, Table ÄÄÆ÷³ÍÆ®ÀÇ OnCellEdit ó·³ ÆíÁý»óÅ¿¡¼ ¹ß»ýÇÏ´Â À̺¥Æ®¿¡¼ SetEvent¸¦ ÀÌ¿ëÇÏ¿© ½ºÅ©¸³Æ®·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
SCRIPT_BEGIN Document.Boards.Board1.Grid1.OnCellEdit
var editor = Grid1.GetCurrentEditor();
_TraceLn("±âÁ¸:"+editor.GetEvent(EventNameConst.OnClick));
editor.SetEvent(EventNameConst.OnClick, "_TraceLn(\"aaa\");");
_TraceLn("ÇöÀç:"+editor.GetEvent(EventNameConst.OnClick));
SCRIPT_END |
4. CellType°ú EditTypeÀÌ ComboBoxÀÎ °æ¿ì
ÀÓÀÇÀÇ ¼¿¿¡ CellTypeÀ» ComboBox(½ÇÁ¦´Â GridCellCombo ÄÄÆ÷³ÍÆ®ÀÓ. A ¶ó°í ¸í¸íÇÔ.)·Î ÁöÁ¤ÇÏ°í, EditTypeÀ» ComboBox(½ÇÁ¦·Îµµ ComboBoxÄÄÆ÷³ÍÆ®ÀÓ. B¶ó°í ¸í¸íÇÔ.)·Î ÁöÁ¤ÇÏ¿´À» ¶§, A ÄÄÆ÷³ÍÆ®ÀÇ Item, ItemValue´Â ¼¿ÀÌ ÆíÁý»óÅ°¡ µÉ ¶§ B ÄÄÆ÷³ÍÆ®¿¡ ÀÚµ¿ ¹ÙÀεùµË´Ï´Ù.
¿¹¸¦ µé¾î, ¾Æ·¡ ½ºÅ©¸³Æ®¿Í °°ÀÌ GridCellComboÀÇ ItemText Çʵå, ItemValue Çʵ带 ÁöÁ¤ÇÑ °æ¿ì EditComponent¿¡ º°µµÀÇ ItemÃß°¡¸¦ ÇÏÁö ¾Ê¾Æµµ ¼¿ÀÌ ÆíÁý»óÅ°¡ µÉ ¶§ GridCellComboÀÇ ItemµéÀÌ EditComponent¿¡ Ãß°¡µÈ °ÍÀ» ½ÇÇà °á°ú¸¦ ÅëÇØ ¾Ë ¼ö ÀÖ½À´Ï´Ù.
// Grid1ÀÇ Ã¹¹ø° Ä÷³ ŸÀÔÀ» ComboBox·Î º¯°æ
Grid1.SelectCellRange(-1, 0, -1, 0);
Grid1.ChangeCellTypeInRange("ComboBox");
// ù¹ø° Ä÷³¼¿ GridCellComboÀÇ ¼Ó¼º ¼³Á¤
Grid1.SetPropertyInRange(PropertyNameConst.ODIKey, "_OZData_");
Grid1.SetPropertyInRange(PropertyNameConst.DataSet, "set2");
Grid1.SetPropertyInRange(PropertyNameConst.Field, "col2");
Grid1.SetPropertyInRange(PropertyNameConst.ValueField, "col1"); |
[Àüü ½ºÅ©¸³Æ®]
SCRIPT_BEGIN Document.Boards.Board1.Grid1.OnPostInitialize
// set1 µ¥ÀÌÅͼ µ¥ÀÌÅ͸¦ Grid1¿¡ º¸¿©ÁÜ
var FXDataModule = _GetFXDataModule();
var FXDataSet = FXDataModule.GetFXDataSet("set1");
var ColCount = FXDataSet.GetColumnCount();
var RowCount = FXDataSet.GetRowCount();
Grid1.AddColumn(ColCount);
Grid1.AddRow(RowCount);
for(var row=0; row < RowCount; row++) {
for(var col=0; col < ColCount; col++) {
Grid1.GetCell(row, col).Value = FXDataSet.GetStringDataByIndex(row, col);
}
}
Grid1.GetTitle(0).Text = "a";
Grid1.GetTitle(1).Text = "b";
Grid1.GetTitle(2).Text = "c";
// Grid1ÀÇ Ã¹¹ø° Ä÷³ ŸÀÔÀ» ComboBox·Î º¯°æ
Grid1.SelectCellRange(-1, 0, -1, 0);
Grid1.ChangeCellTypeInRange("ComboBox");
Grid1.ChangeEditorTypeInRange("ComboBox");
// ù¹ø° Ä÷³¼¿ GridCellComboÀÇ ¼Ó¼º ¼³Á¤
Grid1.SetPropertyInRange(PropertyNameConst.ODIKey, "_OZData_");
Grid1.SetPropertyInRange(PropertyNameConst.DataSet, "set2");
Grid1.SetPropertyInRange(PropertyNameConst.Field, "col2");
Grid1.SetPropertyInRange(PropertyNameConst.ValueField, "col1");
SCRIPT_END
SCRIPT_BEGIN Document.Boards.Board1.Button1.OnClick
// ÀÔ·ÂµÈ row, col ¿¡ ÇØ´çÇÏ´Â GridComboCellÀÇ ItemValue °ª °¡Á®¿À±â
var cell = Grid1.GetCell(TextBox1.Value, TextBox2.Value);
if (cell != null && cell.ComponentType == ComponentTypeConst.GridCellCombo) {
var itemValue = cell.ItemValue();
}
TextBox3.Value = itemValue;
SCRIPT_END |
[GridCellCombo.oza ¹Ì¸®º¸±â]
* ÷ºÎÀÚ·á ¼³¸í
- GridCellCombo.oza : ¼¿ÀÇ CellType°ú EditorTypeÀÌ ComboBoxÀÎ °æ¿ì Item Ãß°¡ ¹× ItemValue¸¦ È®ÀÎÇÏ´Â ¿¹Á¦. (ApplicationDesigner 50.2009,311,100 ¹öÀü¿¡¼ ¸¸µé¾î Á³½À´Ï´Ù.)
- TableCellCombo.oza : ¼¿ÀÇ ColumnType°ú EditComponent°¡ ComboBoxÀÎ °æ¿ì ¿¹Á¦. (ApplicationDesigner 50.2009,408,200 ¹öÀü¿¡¼ ¸¸µé¾î Á³½À´Ï´Ù.)
|