• 0

C# and making a TreeView out of arrays


Question

So I have encountered a probleem while trying to populate a TreeView control with nodes. I hope that there are a some kind people who t?ke the time and help me figuure out a correct solution.

So lets say I have 3 arrays:

 

["Example", "2", "1"]

{"Example", "2", "2"]

["Example", "3", "0"]

 

I know that my arrays have always exactly 3 elements in them, so the treeview will never have more than 3 childnodes

 

But all I am able to get is

 

Example

 2

  1

Example

 2

  2

Example

 3

  0

 

But the goal would be:

 

Example

 2

  1

  2

 3

  0

 

So where would I start chasing down the answer to my probleem?
Big thanks in advance :)

 

 

Recommended Posts

  • 0
  On 28/12/2013 at 04:13, Andre S. said:

I'm not sure if we're talking past each other... this:

new List<string[]> {
     { "a", "b", "c" },
     { "b", "c", "d" }
}

is not and never was legal C#.

 

Yeah, I understood what you meant there. I was trying to make a bad joke and say that using using the valid syntax (with new[]) was good in that case regardless of opinion (because you have to use it). Sorry, I wasn't clear! :)

This topic is now closed to further replies.
  • Posts

    • iPhone 17 series rumored to be unveiled on September 9 by Hamid Ganji Every September holds special significance for Apple enthusiasts: it's when the company unveils its latest iPhone models. As the launch of the iPhone 17 series draws closer, speculation is mounting about the exact date Apple will unveil the new devices. The German website iPhone-Ticker might have the answer. The outlet claims internal information from German mobile phone providers shows that Apple will pull back the curtain on the iPhone 17 series on Tuesday, September 9. This means Apple's event for the latest iPhones is 35 days away. The September 9 timeframe for unveiling the iPhone 17 series actually aligns with last year's release date for the iPhone 16 series. For comparison, the iPhone 15 models were released on September 12, and the iPhone 14 debuted on September 7. Apple never releases phones on September 11, and the reason is quite apparent. Apple's release and preorder pattern for the iPhone 17 series also won't be different this year. After debuting the iPhones on Tuesday, September 9, preorders begin on Friday, September 12. Deliveries also start on September 19. The US, China, Europe, and Japan are the most important markets for Apple, so customers in these areas can expect to get their hands on the iPhone 17 series sooner than anybody else. But the iPhone 17 series might not debut alone at the upcoming September event. Apple Watch Series 11, the new Apple Watch Ultra, and the next-generation AirPods Pro are other products we expect to make a debut alongside the iPhone 17 models. All the previous rumors surrounding the iPhone 17 series converge on one key point: a significantly redesigned back, featuring changes such as a repositioned camera module and a relocated Apple logo. An alleged iPhone 17 Pro unit was recently spotted in public, seemingly confirming the rumors about its redesigned back panel. Apple is also rumored to replace the Plus variant in the iPhone 17 series with a so-called Air or Slim model.
    • A new detection method reveals a potentially habitable super-Earth. The breakthrough boosts the search for life-supporting planets. “Are we alone?” This enduring question has fascinated humanity for generations. The discovery in 1995 of the first exoplanet orbiting a star similar to our Sun marked a pivotal moment in addressing that mystery. Since then, exoplanet research has become a central focus of modern astronomy, offering critical insights into how planets form, evolve, and possibly support life. A major objective in this field is finding Earth-like life, which hinges on locating planets with Earth-like conditions in the habitable zones of Sun-like stars. In their search for Earth-like worlds, an international team led by the Yunnan Observatories of the Chinese Academy of Sciences (CAS), in collaboration with other institutions, made a significant breakthrough using a method called Transit Timing Variation (TTV). https://scitechdaily.com/earth-2-0-breakthrough-discovery-reveals-potentially-habitable-super-earth/
    • >The latest tvOS 26 even hints that the new Apple TV could come with a built-in camera. Sigh... No one is asking for that.
    • Been using Wipr and it has been great. Will test this out.
  • Recent Achievements

    • One Month Later
      Celilo earned a badge
      One Month Later
    • Dedicated
      Joey Solo earned a badge
      Dedicated
    • One Year In
      BergerMeister earned a badge
      One Year In
    • One Month Later
      ENAQUE earned a badge
      One Month Later
    • Week One Done
      ENAQUE earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      755
    2. 2
      ATLien_0
      198
    3. 3
      +FloatingFatMan
      161
    4. 4
      wakjak
      122
    5. 5
      Xenon
      119
  • Tell a friend

    Love Neowin? Tell a friend!