crazypiggy Цитата: Чуть позже, подправлю ваш пример.
Как и обещал, немного подправленный ваш пример:
[more=dfm]
Код: object Form1: TForm1
Left = 192
Top = 114
Caption = 'Form1'
ClientHeight = 604
ClientWidth = 854
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object cxDBTreeList1: TcxDBTreeList
Left = 0
Top = 41
Width = 854
Height = 563
Align = alClient
Bands = <
item
end>
DataController.DataSource = DataSource1
DataController.ParentField = 'OWNER_SPR_MENU_ID'
DataController.KeyField = 'ID'
DragMode = dmAutomatic
OptionsBehavior.ImmediateEditor = False
OptionsBehavior.AutoDragCopy = True
OptionsBehavior.DragDropText = True
OptionsBehavior.DragFocusing = True
OptionsData.Inserting = True
OptionsData.AutoCalcKeyValue = True
OptionsView.ColumnAutoWidth = True
OptionsView.GridLines = tlglBoth
OptionsView.Indicator = True
OptionsView.TreeLineStyle = tllsSolid
RootValue = -1
TabOrder = 1
OnDragOver = cxDBTreeList1DragOver
ExplicitTop = 44
object cxDBTreeList1ID: TcxDBTreeListColumn
Visible = False
Caption.AlignHorz = taCenter
Caption.GlyphAlignHorz = taCenter
Caption.Text = #8470' '#1087'.'#1087'.'
DataBinding.FieldName = 'ID'
Width = 59
Position.ColIndex = 0
Position.RowIndex = 0
Position.BandIndex = 0
Summary.FooterSummaryItems = <>
Summary.GroupFooterSummaryItems = <>
end
object cxDBTreeList1LOGO: TcxDBTreeListColumn
PropertiesClassName = 'TcxBlobEditProperties'
Properties.BlobEditKind = bekPict
Properties.ClearKey = 16452
Properties.PictureGraphicClassName = 'TJPEGImage'
Caption.AlignHorz = taCenter
Caption.GlyphAlignVert = vaCenter
Caption.Text = #1051#1086#1075#1086#1090#1080#1087
DataBinding.FieldName = 'LOGO'
Width = 135
Position.ColIndex = 2
Position.RowIndex = 0
Position.BandIndex = 0
Summary.FooterSummaryItems = <>
Summary.GroupFooterSummaryItems = <>
end
object cxDBTreeList1NAME: TcxDBTreeListColumn
Caption.AlignHorz = taCenter
Caption.GlyphAlignHorz = taCenter
Caption.Text = #1053#1072#1080#1084#1077#1085#1086#1074#1072#1085#1080#1077
DataBinding.FieldName = 'NAME'
Width = 438
Position.ColIndex = 1
Position.RowIndex = 0
Position.BandIndex = 0
Summary.FooterSummaryItems = <>
Summary.GroupFooterSummaryItems = <>
end
object cxDBTreeList1OWNER_SPR_MENU_ID: TcxDBTreeListColumn
Visible = False
DataBinding.FieldName = 'OWNER_SPR_MENU_ID'
Position.ColIndex = 3
Position.RowIndex = 0
Position.BandIndex = 0
Summary.FooterSummaryItems = <>
Summary.GroupFooterSummaryItems = <>
end
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 854
Height = 41
Align = alTop
BevelInner = bvLowered
TabOrder = 0
object AddButton: TSpeedButton
Left = 8
Top = 5
Width = 32
Height = 33
Caption = '+'
OnClick = AddButtonClick
end
object DelButton: TSpeedButton
Left = 88
Top = 5
Width = 32
Height = 33
Caption = '-'
OnClick = DelButtonClick
end
object EditButton: TSpeedButton
Left = 48
Top = 5
Width = 32
Height = 33
Caption = '!'
OnClick = EditButtonClick
end
object SpeedButton1: TSpeedButton
Left = 136
Top = 5
Width = 121
Height = 33
Caption = #1057#1086#1093#1088#1072#1085#1080#1090#1100
OnClick = SpeedButton1Click
end
object SpeedButton2: TSpeedButton
Left = 272
Top = 5
Width = 121
Height = 33
Caption = #1054#1090#1084#1077#1085#1080#1090#1100
OnClick = SpeedButton2Click
end
end
object DataSource1: TDataSource
DataSet = FIBSPRMenu
Left = 472
Top = 80
end
object FIBSPRMenu: TpFIBDataSet
UpdateSQL.Strings = (
'UPDATE SPR_MENU'
'SET '
' LOGO = :LOGO,'
' NAME = :NAME,'
' OWNER_SPR_MENU_ID =
WNER_SPR_MENU_ID'
'WHERE'
' ID =
LD_ID'
' ')
DeleteSQL.Strings = (
'DELETE FROM'
' SPR_MENU'
'WHERE'
' ID =
LD_ID'
' ')
InsertSQL.Strings = (
'INSERT INTO SPR_MENU('
' ID,'
' LOGO,'
' NAME,'
' OWNER_SPR_MENU_ID'
')'
'VALUES('
' :ID,'
' :LOGO,'
' :NAME,'
'
WNER_SPR_MENU_ID'
')')
RefreshSQL.Strings = (
'SELECT'
' ID,'
' LOGO,'
' NAME,'
' OWNER_SPR_MENU_ID'
'FROM'
' SPR_MENU '
''
' WHERE '
' SPR_MENU.ID =
LD_ID'
' ')
SelectSQL.Strings = (
'SELECT'
' ID,'
' LOGO,'
' NAME,'
' OWNER_SPR_MENU_ID'
'FROM'
' SPR_MENU '
'ORDER BY ID')
AutoUpdateOptions.UpdateTableName = 'SPR_MENU'
AutoUpdateOptions.KeyFields = 'ID'
AutoUpdateOptions.AutoReWriteSqls = True
AutoUpdateOptions.CanChangeSQLs = True
AutoUpdateOptions.GeneratorName = 'GEN_SPR_MENU_ID'
AutoUpdateOptions.UpdateOnlyModifiedFields = True
AutoUpdateOptions.AutoParamsToFields = True
Transaction = pFibTransactionRead
Database = pFIBDatabase1
UpdateTransaction = pFibTransactionWrite
RefreshTransactionKind = tkUpdateTransaction
Left = 504
Top = 80
object FIBSPRMenuID: TFIBIntegerField
FieldName = 'ID'
end
object FIBSPRMenuLOGO: TFIBBlobField
FieldName = 'LOGO'
Size = 8
end
object FIBSPRMenuNAME: TFIBStringField
FieldName = 'NAME'
Size = 150
EmptyStrToNull = True
end
object FIBSPRMenuOWNER_SPR_MENU_ID: TFIBIntegerField
FieldName = 'OWNER_SPR_MENU_ID'
end
end
object pFIBDatabase1: TpFIBDatabase
DBName = 'BD.FDB'
DBParams.Strings = (
'lc_ctype=WIN1251'
'user_name=SYSDBA'
'password=masterkey')
DefaultTransaction = pFibTransactionRead
DefaultUpdateTransaction = pFibTransactionWrite
SQLDialect = 3
Timeout = 0
LibraryName = 'C:\Program Files\Firebird\Firebird_2_1\bin\fbclient.dll'
WaitForRestoreConnect = 0
Left = 520
Top = 152
end
object pFibTransactionWrite: TpFIBTransaction
DefaultDatabase = pFIBDatabase1
TimeoutAction = TACommitRetaining
TRParams.Strings = (
'write'
'nowait'
'rec_version'
'read_committed')
TPBMode = tpbDefault
Left = 552
Top = 187
end
object pFibTransactionRead: TpFIBTransaction
DefaultDatabase = pFIBDatabase1
TimeoutAction = TARollback
TRParams.Strings = (
'read'
'nowait'
'rec_version'
'read_committed')
TPBMode = tpbDefault
Left = 520
Top = 187
end
end