Insert child nodes gridview cells are blank

2 posts, 0 answers
  1. Mark
    Mark avatar
    50 posts
    Member since:
    Dec 2010

    Posted 04 Mar 2014 Link to this post

    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.

    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;
                    oParentNode.ChildNodes = lNodes.ToObservableCollection();
  2. Yoan
    Yoan avatar
    1051 posts

    Posted 07 Mar 2014 Link to this post

    Hello Mark,

    Let me go straight to your questions:

    1. I am afraid that with the supplied information I cannot figure out what is going on. Would it be possible to share with us more details on your exact implementation? It would be great if you can send me a small sample with dummy data in order to investigate the issue locally.
    2. In order to achieve your goal, you can use CelltemplateSelector. Please check this help article for a reference.

    Looking forward to hearing from you! 


    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

  3. DevCraft R3 2016 release webinar banner
Back to Top