S
Sol Fried
Here's the problem,
I am populating a TreeView with the contents of a (Strongly typed) dataset.
for (int i = 0; i < dataSet.Cust.Rows.Count; i++) {
DataSet.CustRow row = (DataSet.CustRow)dataSet.Cust.Rows;
TreeNode node = treeView1.Nodes.Add(row.CUST_NAME);
node.Tag = row.CUST_ID;
}
I also have several field controls on the Form which are dataBound to the
dataset fields.
In the tree node AfterSelect event, I am trying to move the
CurrencyManager.Postion value so that the Bound fields are updated with the
values in the corresponding rows. (It would have been nice to have a
databound treeview control)
I retrieve the node.Tag and do a Find on the dataset row. This does not
move the Postion in the Currency Manager.
I tried saving the Position in the node.Tag. That worked until I started
inserting new nodes into the Dataset and could not find the Position in the
Currency Manager refering to the inserted dataset row.
I also tried using CurrencyManager.AddNew(). The Position does not seem to
change on that command and I am not clear as to how a new dataRow is added
and populated as a result of AddNew.
Any ideas how to implement this?
Thanks
Sol
I am populating a TreeView with the contents of a (Strongly typed) dataset.
for (int i = 0; i < dataSet.Cust.Rows.Count; i++) {
DataSet.CustRow row = (DataSet.CustRow)dataSet.Cust.Rows;
TreeNode node = treeView1.Nodes.Add(row.CUST_NAME);
node.Tag = row.CUST_ID;
}
I also have several field controls on the Form which are dataBound to the
dataset fields.
In the tree node AfterSelect event, I am trying to move the
CurrencyManager.Postion value so that the Bound fields are updated with the
values in the corresponding rows. (It would have been nice to have a
databound treeview control)
I retrieve the node.Tag and do a Find on the dataset row. This does not
move the Postion in the Currency Manager.
I tried saving the Position in the node.Tag. That worked until I started
inserting new nodes into the Dataset and could not find the Position in the
Currency Manager refering to the inserted dataset row.
I also tried using CurrencyManager.AddNew(). The Position does not seem to
change on that command and I am not clear as to how a new dataRow is added
and populated as a result of AddNew.
Any ideas how to implement this?
Thanks
Sol