Home > Back-end >  About cxDBtreeList lines of data to the database operation will be selected
About cxDBtreeList lines of data to the database operation will be selected

Time:02-11

XE10.3.3 + cxDBTreeList
Design: I'm in a menu to the specified character display function, will be written to the selected menu item database,

MenuTree:=TcxDBTreeList;

I'm MenuTree OptionsView - & gt; Set up a True CheckGroups


MenuTree. OndblClick event
 
Procedure TfrmDesignRole. MenuTreeDblClick (Sender: TObject);
The begin
Inherited;
MenuTree. FocusedNode. Checked:=not MenuTree FocusedNode. Checked;
Menutree. FocusedNode. Selected:=Menutree. FocusedNode. Checked;
end;


Perform the following process in the process of the save
 
For I:=0 to MenuTree. Do SelectionCount - 1
The begin
. .
//to write cycle to the data into the database
The end;

Found selecttioncount do not agree with me to check the number of entries.
I clearly double-click only saved when he chose five rows stored in a record
I'm MenuTree. Specifies the ondblClick event double-click the Checked to True if a selected? Please everybody to give directions

CodePudding user response:

Write the line every time is I double click the line finally,
MenuTree. OptionsSelection - & gt; CellSelect HideFocusRect, HideSelection InvertSelect, the value of the MultiSelect is set True

CodePudding user response:

Have not used your cxDBTreeList controls, don't know how to define it is Selection

You can test the:
ICheckedNodeCount:=0;
For I:=0 to MenuTree. Do NodeCount - 1
If MenuTree. Nodes [I]. Checked then
INC (iCheckedNodeCount);
Application. MessageBox (PChar (' there are a total of: '+ IntToStr (iCheckedNodeCount) +' node is selected. '), 'system');

So you can know whether you use SelectionCount attribute right

//code without computer test, host computer should make a little change
  • Related