Hi Telerik,
I'm developing an application using your RadGridView to display a list of production orders with a selection of data. Now I'm facing an issue where some values on the order cannot be bound at compile time, since they can differ depending on the production site that loads the list of orders. For keeping things as simple as possible, consider the following objects that needs to shown in a gridview:
Now, the number and values of MachineSpeed is unknown at compile time, but lets assume that during runtime a SiteOrderHeader would be loaded with the following data:
This should result in the following grid layout, where the MachineSpeed types are columns and the speed is the value.
All SiteOrderHeader that should be shown in the same grid will have the exact same MachineSpeed types but different values, so I could easily add the columns on runtime, but how can I map the speed values to the corrosponding type?
I would prefer if this could be databound in some way during runtime without the need of knowning the MachineSpeed types.
Please guide on suggested way to do this with RadGridView. I can also change the class layout of SiteOrderHeader and MachineSpeed if this could be build in a way that fits into RadGridView, i.e. use a Dictionary<string, int> for the MachineSpeed definition..
Any help would be much appriciated.
Best regards,
Kasper Schou
I'm developing an application using your RadGridView to display a list of production orders with a selection of data. Now I'm facing an issue where some values on the order cannot be bound at compile time, since they can differ depending on the production site that loads the list of orders. For keeping things as simple as possible, consider the following objects that needs to shown in a gridview:
public
class
SiteOrderHeader
{
public
int
SiteOrderId {
get
;
set
; }
public
List<MachineSpeed> MachineSpeeds {
get
;
set
; }
}
public
class
MachineSpeed
{
public
string
Type {
get
;
set
; }
public
int
Speed {
get
;
set
; }
}
Now, the number and values of MachineSpeed is unknown at compile time, but lets assume that during runtime a SiteOrderHeader would be loaded with the following data:
SiteOrderHeader siteOrderHeader =
new
SiteOrderHeader();
siteOrderHeader.SiteOrderId = 1;
siteOrderHeader.MachineSpeeds.Add(
new
MachineSpeed() { Type =
"Type1"
, Speed = 10000 });
siteOrderHeader.MachineSpeeds.Add(
new
MachineSpeed() { Type =
"Type2"
, Speed = 6000 });
siteOrderHeader.MachineSpeeds.Add(
new
MachineSpeed() { Type =
"Type3"
, Speed = 12000 });
This should result in the following grid layout, where the MachineSpeed types are columns and the speed is the value.
SiteOrderId | Type1 | Type2 | Type3 |
1 | 10000 | 6000 | 12000 |
All SiteOrderHeader that should be shown in the same grid will have the exact same MachineSpeed types but different values, so I could easily add the columns on runtime, but how can I map the speed values to the corrosponding type?
I would prefer if this could be databound in some way during runtime without the need of knowning the MachineSpeed types.
Please guide on suggested way to do this with RadGridView. I can also change the class layout of SiteOrderHeader and MachineSpeed if this could be build in a way that fits into RadGridView, i.e. use a Dictionary<string, int> for the MachineSpeed definition..
Any help would be much appriciated.
Best regards,
Kasper Schou