How do we automatically renumber the GRID lines?



  • I have a tree XAML I can edit and add so many children. Yes. Grid in which two fields are displayed номер i описание поляWe need to make an automatic counting in the grid field, but take the first numbers from the tree and the last one from the field number, so if the tree has a three-level system, the field should be hit. 1.1.1

    введите сюда описание изображения

    How do you renumber it?



  • You don't have to dig in the grid, but you need to do your model already tied to the interface. The structure itself shall have two properties -

    public int Num {get; set;} //для хранения номера строки в узле и 
    public string Nr 
    {
        get { return Node.Nr + '.' + Num.ToString(); } //Node - узел в котором хранится строка
        private set {}
    }
    

    You have to do the same in the knot.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2