This question is locked. New answers and comments are not allowed.
I have a TreeListView with 6 additional columns, loading approx 200 nodes.
When the user selects a currency from a combobox the VM adds additional nodes to the leaf nodes and updates some totals on some parent nodes.
The update works but when inserting the new child nodes the label in the first column populates but none of the gridview values are displayed. The same cells updated on the parent display the new value.
A second issue is that I would like to add an image to the hierarchy column but cannot work out how to style the cell.
I attach the VM code.
When the user selects a currency from a combobox the VM adds additional nodes to the leaf nodes and updates some totals on some parent nodes.
The update works but when inserting the new child nodes the label in the first column populates but none of the gridview values are displayed. The same cells updated on the parent display the new value.
A second issue is that I would like to add an image to the hierarchy column but cannot work out how to style the cell.
I attach the VM code.
private
void
SetNode(TreeNodeStrategy oParentNode)
{
oParentNode.CurrencyType =
string
.Empty;
oParentNode.RateIndex =
string
.Empty;
oParentNode.RateType =
string
.Empty;
oParentNode.Frequency =
string
.Empty;
oParentNode.FaceAmount = 0;
oParentNode.BookValue = 0;
oParentNode.Apportion = 0;
//Update existing node total - works fine
NodeCurrencyTypeDB oNCT = lNodeCurrencyType.Where(x => x.NodeKey == oParentNode.NodeKey & x.CurrencyType == SelectedCurrencyType).FirstOrDefault();
if
(oNCT !=
null
)
{
oParentNode.FaceAmount = oNCT.Amount;
}
//add the new child nodes to the parent node - node is added but the gridview value do not display
if
(lStrategyConfig.Where(x => x.NodeKey == oParentNode.NodeKey & x.CurrencyType == SelectedCurrencyType).Count() > 0)
{
List<TreeNodeStrategy> lNodes =
new
List<TreeNodeStrategy>();
foreach
(StrategyConfigDB oConfig
in
lStrategyConfig.Where(x => x.NodeKey == oParentNode.NodeKey & x.CurrencyType == SelectedCurrencyType))
{
string
sNodeKey =
string
.Format(
"{0}{1}/"
, oParentNode.NodeKey, oConfig.StrategyConfigID);
TreeNodeStrategy oNode =
new
TreeNodeStrategy(oConfig.RateIndex, oParentNode,
null
, oConfig, sNodeKey, oParentNode.ChildNodes.Count());
oNode.CurrencyType = oConfig.CurrencyType;
oNode.RateIndex = oConfig.RateIndex;
oNode.RateType = oConfig.RateType;
oNode.Frequency = oConfig.ReferenceName;
oNode.FaceAmount = oConfig.FaceAmount;
oNode.BookValue = oConfig.BookValue;
oNode.Apportion = oConfig.Apportion;
lNodes.Add(oNode);
}
oParentNode.ChildNodes = lNodes.ToObservableCollection();
}
}