I have TreeView component and in Tag property I put row from datatable:
Expand|Select|Wrap|Line Numbers
- foreach (DataRow row in catalogDataSet.category)
- {
- if (row["parent"].ToString().Equals("0"))
- {
- TreeNode node = new TreeNode();
- node.Text = row["name"].ToString();
- node.Tag = row;
- string nodeId = row["id"].ToString();
- if (this.HasChilds(nodeId))
- {
- this.fillChilds(nodeId, node);
- }
- tree.Nodes.Add(node);
- }
- }
Expand|Select|Wrap|Line Numbers
- int locationId = int.Parse(((DataRow)locationTreeView.SelectedNode.Tag)["id"].ToString());
RowNotInTableException:
Expand|Select|Wrap|Line Numbers
- This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.