* °³¿ä
Table component¿¡¼ InsertRow() method¸¦ ÀÌ¿ëÇØ Row¸¦ Ãß°¡ÇÏ°í data¸¦ ÀÔ·Â, ÀúÀåÇÒ ¶§ AppyToDataSet¼Ó¼ºÀ» true·Î ¼³Á¤Çϸé DB¿¡ dataÀúÀåÀÌ ¾ÈµÇ´Â °æ¿ì°¡ ¹ß»ýÇϴµ¥ ÀÌ¿¡ ´ëÇÑ ¿øÀÎÀ» ¼³¸íÇÏ°í Table component¿¡¼ Grid componentÀÇ methodÀÎ InsertRow()¸¦ »ç¿ëÇÏÁö ¸»¾Æ¾ß ÇÏ´Â ÀÌÀ¯¿¡ ´ëÇØ ¼³¸íÇÕ´Ï´Ù.
* »ó¼¼ ¼³¸í
Table component¿¡¼ Row¸¦ Ãß°¡ÇØ data¸¦ ÀÔ·ÂÇÑ ÈÄ ÀúÀåÇÒ ¶§ InsertRow() method¸¦ »ç¿ëÇÑ °æ¿ì, AppyToDataSet ¼Ó¼ºÀ» ¾î¶»°Ô ¼³Á¤Çß´À³Ä¿¡ µû¶ó Row¿¡ ÀÔ·ÂÇÑ data°¡ Á¤»óÀûÀ¸·Î DB¿¡ ÀúÀåµÇÁö ¾Ê´Â ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù.
¿¹1)
- [ÀúÀå] button click½Ã ´ÙÀ½°ú °°ÀÌ dataÀÇ insertó¸®
_GetDataManager().GetDataModule("ODI¸í").CleanUpQueuedActions(); var result = Table1.CommitQueuedActions();
- [Row»ðÀÔ] button click½Ã scriptó¸®
var row = Table1.GetFocusRowIndex(); var col = Table1.GetFocusColumnIndex();
Table1.InsertRow(row +1,1); Table1.SetFocusCell(row +1, col);
Table component¿¡¼ AppyToDataSet ¼Ó¼ºÀ» true·Î ¼³Á¤ÇÑ »óÅ¿¡¼ table¿¡ Row¸¦ Ãß°¡ÇØ data¸¦ ÀÔ·ÂÇÑ ÈÄ ÀúÀåÇϸé Viewer ȸé»ó¿¡¼´Â DB¿¡ ÀúÀåµÈ °Íó·³ º¸ÀÌÁö¸¸ ½ÇÁ¦·Î´Â Ãß°¡ÇÑ Row¿¡ ÀÔ·ÂÇÑ data´Â DB¿¡ ÀúÀåµÇÁö ¾Ê½À´Ï´Ù. ±×·¯³ª Table componentÀÇ AppyToDataSet¼Ó¼ºÀ» false·Î ¼³Á¤ÇÑ »óÅ¿¡¼ table¿¡ Row¸¦ Ãß°¡ÇØ dataÀÔ·ÂÈÄ ÀúÀå butonÀ» clcikÇϸé, ½ÇÁ¦ DB¿¡ viewer¿¡¼ ÀÔ·ÂÇÑ data°¡ ÀúÀåµÈ °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
¿¹1)ÀÇ °æ¿ì´Â Table componentÀÇ AppyToDataSet ¼Ó¼º°ªÀÇ ¼³Á¤¿¡ µû¶ó dataÀÇ insert °¡´É/ºÒ°¡´ÉÀÇ ¿µÇâÀ» ¹Þ°í ÀÖ½À´Ï´Ù.
Table componentÀÇ ¼Ó¼ºÁß ApplyToDataSetÀº CellÀÇ °ªÀÌ º¯°æµÈ °æ¿ì DataSet¿¡ ¹Ý¿µÇÒÁö ¿©ºÎ¸¦ ¼³Á¤ÇÏ´Â ¼Ó¼ºÀÔ´Ï´Ù. ±×·¯¹Ç·Î ApplyToDataSet¼Ó¼ºÀÌ trueÀÎ °æ¿ì¿¡´Â Ãß°¡µÈ RowÀÇ dataÀÇ Insert¸¦ TableÀÇ ÇÔ¼ö¸¦ ÀÌ¿ëÇÏ´Â °ÍÀÌ ¾Æ´Ï°í, DataSetÀÇ Insert¹®À» ¿¹2)¿Í °°ÀÌ ÀÌ¿ëÇØ¾ß ÇÕ´Ï´Ù.
¿¹2)
Table1.GetDataSet().InsertRow(row + 1);
±×¸®°í ¿¹1)¿¡ ÀÛ¼ºÇÑ ½ºÅ©¸³Æ®´Â Á¤»óÀûÀ¸·Î ½ÇÇàµÈ °ÍÀÌ ¾Æ´Õ´Ï´Ù.
Table componentÀÇ InsertRow() method´Â Áö¿øÇÏÁö ¾Ê´Â ÇÔ¼öÀÔ´Ï´Ù. Grid comnponentÀÇ methodÀÔ´Ï´Ù. Table componentÀÇ InsertRow() method´Â ÀÌÀü ¹öÀü°úÀÇ È£È¯À» À§ÇØ ³²°ÜµÐ methodÀÔ´Ï´Ù.
¿¹1)ÀÇ script¿¡¼ ½ÇÇàÀÌ ¼º°øÇÑ °ÍÀº InsertRowÇÑ ÈÄ CommitQueuedActions() ¿¡¼ Update Query°¡ ½ÇÇà µÇ¸é¼ ¼º°øÇÑ °ÍÀÔ´Ï´Ù.
Table component¿¡¼ InsertNewRow() method¸¦ »ç¿ëÇϱ⠹ٶø´Ï´Ù.
Table componentÀÇ InsertRow() methodÀÇ »ç¿ëÀ» ±ÇÀåÇÏÁö ¾Ê½À´Ï´Ù.
»ó±âÀÇ ³»¿ëÀ» Á¤¸®Çϸé, ApplyToDataSet = true ÀÏ °æ¿ì, DatasetÀÇ Insert, Commit.. method¸¦ »ç¿ëÇÏ°í, ApplyToDataSet = false ÀÏ °æ¿ì, TableÀÇ InsertNewRow, Commit method¸¦ »ç¿ëÇϱ⠹ٶø´Ï´Ù.
|