I have a tcxTreeList with 3 columns the first column has set property of
Node.CheckGroupType := ncgCheckGroup;, and 2nd column contains Key of the First root node and third column contains the keys of all child nodes under the root node.
How can i get the key of root node whether it is checked or not and keys of all checked child nodes into 2 variables to insert into db and Load back items from keys we get from DB

My code for adding items is as below
APNode := tv.Add;
APNode.CheckGroupType := ncgCheckGroup;
APNode.Values[0] := define;
ApNode.Values[1] := dCode;
define - contains Text like Created, Released,In-Active etc.. all Root nodes dcode - contains key value of each root node like E,F,I,P,R
This is how i added child nodes for each root node
procedure TF_Form1.addPStatsToTreeList(tl: TcxTreeList; const dcode, define: string);
function AddTreeListNode(TreeList: TcxTreeList; APNode: TcxTreeListNode; const AValues: Array of Variant; AImageIndex: Integer): TcxTreeListNode;
begin
Result := TreeList.AddChild(APNode);
Result.AssignValues(AValues);
Result.Imageindex := AImageIndex;
end;
var
grpnode,chNode, ANode: TcxTreeListNode;
icnt : integer;
begin
icnt := tl.Count;
if Assigned(tl) then
begin
ANode := tl.TopNode;
while ANode <> nil do
begin
ANode := AddTreeListNode(tl, ANode, [define, '', dcode], 0);
ANode := TcxTreeListNode(ANode.GetNext);
end;
end;
end;
UPDATE
dcode is a single letter and Definition is a string, Dcode is the key for string in definition, Like a key-value pair Dcode is key and definition is value.
In the tree list root nodes like Created, Released, In Active, Checked and Reactivated have different Key which is in column1 and key for subnode values like Sample, Development, Production etc.. is in 3rd column.
Only Key values are saved to DB, root node keys are saved directly whether they are Checked or not. Each root node key will be saved to different rows and coming to subnodes only Checked nodes keys are saved to DB with comma separated.
For Example . If Root node Created and items under it like Sample , Development are checked then root node key E is one column[DEFCODE(Primarykey)] and subnodes keys M,E (DEFINITION) with coma separated are in other column.
codeand other fordefineThecodeshould contain all keys of Root nodes in each row wheredefinecontains the keys of checked nodes under the root node - userhiNode.ParentandNode.HaschildrenandNode.ChildCount. You can achieve your goals using the object properties provided. - Freddie Bell