public class csNodeInfo { public int RowId { get; set; } public NodeType Type { get; set; } public int ProductId { get; set; } public string Product_Series { get; set; } public string Product_Name { get; set; } public string Product_Number { get; set; } public string Category {get; set;} public int PartId { get; set; } public string Part_Number {get; set;} public string Part_Description {get; set;} public string Tribal { get; set; } public bool IsTribalSelected { get; set; } public decimal PartPrice { get; set; } public int QuantityReq { get; set; } public int PartRatio { get; set; } public int WhseQty1 { get; set; } public int WhseQty2 { get; set; } }First, when the node is selected I do this:
csNodeInfo NodeInfo = (csNodeInfo)Node.Tag;
cmdPrice.Enabled = (NodeInfo.Type == NodeType.Price);
Clicking the node, and the Click event of cmdPrice does this:TreeNode Node = tvwResults.SelectedNode; Node.BeginEdit();Then in BeforeLabelEdit I do this:
decimal Price = 0.00M; csNodeInfo NodeInfo = (csNodeInfo)Node.Tag; foreach (DataRow Row in csCOSApp.ActiveProject.dsDataStore.Tables[0].Rows) { if ((int)Row["RowId"] == NodeInfo.RowId) { Price = (decimal)Row["PartPrice"]; break; } } Node.Text = Price.ToString();Now here's where the problem presents. As soon as the node gets the focus the text reverts back from "0" to "Price $ 0.00". EndEdit has not been called at this point.
MessageBox.Show(Node.Text);It shows "0", yet the actual displauy value is "Price $ 0.00".