This is a migrated thread and some comments may be shown as answers.

The way to display my data.

0 Answers 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grzesiek
Top achievements
Rank 2
Grzesiek asked on 03 Apr 2012, 08:59 PM
Hello!

I would like to achieve this result as show in the picture (attachment).
Should I use RadGridView control? Or maybe there is some way to use ListBox instead of GridView?

I have my object's class:

public class Reinforcement
   {
       private string fi;
       private bool spacingMode;
       private int amount;
       private double spacing;
       private bool combine = false;
       private double area;
 
       public Reinforcement()
       {
       }
 
       public Reinforcement(string fi, bool spacingMode, int amount, double spacing, bool combine)
       {
           Fi = fi;
           SpacingMode = spacingMode;
           Amount = amount;
           Spacing = spacing;
           Combine = combine;
       }
 
       public string Fi
       {
           get
           {
               return this.fi;
           }
           set
           {
               this.fi = value;
           }
       }
         // (...) 
}


And ViewModel:

public class ReinforcementViewModel
    {
        private static ObservableCollection<Reinforcement> reinforcementsByAmount;
        private static ObservableCollection<Reinforcement> reinforcementsBySpacing;
 
        public static ObservableCollection<Reinforcement> ReinforcementByAmount
        {
            get
            {
                if (reinforcementsByAmount == null)
                {
                    reinforcementsByAmount = new ObservableCollection<Reinforcement>();
 
                    for (int i = 1; i <= 10; i++)
                    {
                        reinforcementsByAmount.Add(new Reinforcement("10", false, i, 1, false));
                        reinforcementsByAmount.Add(new Reinforcement("12", false, i, 1, false));
 (...)
                    }
                }
 
                return reinforcementsByAmount;
            }
        }


Any ideas or/and tips for me?

I thought that with ListBox I could use panel with specify width and each cell has also specify width. In this way I can wrap items to the next row by calculating width.
 
After that I would like to create an event on cell's click, which return me the Area value. But with this I think I wouldn't have a problem.

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Grzesiek
Top achievements
Rank 2
Share this question
or