RobotStudio event

ListView example

Hi

Where can I find an example about listview with 3 or 4 columns? headers

BR

Jordi

Jordi Saboya

Comments

  • For c#, VB, etc? Can you be more specific?

    Alex
  • I'm also interested... Howto needed in Developer Center?

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • If you're using c# you define the number of columns in the UI designer. Assuming you named your listView scanning_window, something like this should work: 

    this.scanner = new ABB.Robotics.Controllers.Discovery.NetworkScanner();
                scanner.Scan();
                ControllerInfoCollection collection = null; 
                

                if (scanner.Controllers.Count > 0)
                {
                    collection = scanner.Controllers;
                    ListViewItem item = null;

                    scanning_window.Items.Clear();
                    foreach (ControllerInfo controllerInfo in collection)
                    {
                        item = new ListViewItem(controllerInfo.IPAddress.ToString());
                        item.SubItems.Add(controllerInfo.Id);
                        item.SubItems.Add(controllerInfo.Availability.ToString());
                        item.SubItems.Add(controllerInfo.IsVirtual.ToString());
                        item.SubItems.Add(controllerInfo.SystemName);
                        item.SubItems.Add(controllerInfo.Version.ToString());
                        item.SubItems.Add(controllerInfo.ControllerName);
                        scanning_window.Items.Add(item);
                        item.Tag = controllerInfo;
                    }
                }