Hi,
I've got a tree view. It contains no. of tree nodes. Each node contains child nodes.
For example,
Node1 - Display contents of dataset1(in the click event)
-ChildNode1(Display contents of dataset2 in click event)
-ChildNode2(Display contents of dataset3 in click event)
-ChildNode3(Display contents of dataset4 in click event)
-ChildNode4(Display contents of dataset5 in click event)
Node2
Node3
.
.
.
I need to display relevant text in the rich edit control i have in the form when user clicks on each node and each child node. The code i used is as follows:
In the Tree view on click event,
SelectedIndex := TreeView.Selected.Index;
If TreeView.Items.Item[SelectedIndex ].Selected Then
RE_Viewer.Text := DataSet1.Content
Else If TreeView.Items.Item[SelectedIndex].Item[0].Selected Then
RE_Viewer.Text := DataSet2.Content
Else If TreeView.Items.Item[SelectedIndex].Item[1].Selected Then
RE_Viewer.Text := DataSet3.Content
Else If TreeView.Items.Item[SelectedIndex].Item[2].Selected Then
RE_Viewer.Text := DataSet4.Content
Else If TreeView.Items.Item[SelectedIndex].Item[3].Selected Then
RE_Viewer.Text := DataSet5.Content;
But this code doesn't give the expected output. It raised an exception saying list index out of bounce. Can any one help me to solve this problem.
Thank you so much for u r help in advance...
Sanjna...
I've got a tree view. It contains no. of tree nodes. Each node contains child nodes.
For example,
Node1 - Display contents of dataset1(in the click event)
-ChildNode1(Display contents of dataset2 in click event)
-ChildNode2(Display contents of dataset3 in click event)
-ChildNode3(Display contents of dataset4 in click event)
-ChildNode4(Display contents of dataset5 in click event)
Node2
Node3
.
.
.
I need to display relevant text in the rich edit control i have in the form when user clicks on each node and each child node. The code i used is as follows:
In the Tree view on click event,
SelectedIndex := TreeView.Selected.Index;
If TreeView.Items.Item[SelectedIndex ].Selected Then
RE_Viewer.Text := DataSet1.Content
Else If TreeView.Items.Item[SelectedIndex].Item[0].Selected Then
RE_Viewer.Text := DataSet2.Content
Else If TreeView.Items.Item[SelectedIndex].Item[1].Selected Then
RE_Viewer.Text := DataSet3.Content
Else If TreeView.Items.Item[SelectedIndex].Item[2].Selected Then
RE_Viewer.Text := DataSet4.Content
Else If TreeView.Items.Item[SelectedIndex].Item[3].Selected Then
RE_Viewer.Text := DataSet5.Content;
But this code doesn't give the expected output. It raised an exception saying list index out of bounce. Can any one help me to solve this problem.
Thank you so much for u r help in advance...
Sanjna...