0
@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.AirlineCode).Title("Airline");
        columns.Bound(p => p.SegmentInfo[0].FareClass).Title("Fare Class");
    }
    .ClientRowTemplate( 
        "<tr>"+
        "<td style =\"width: 130px\"><img src=\"/Content/themes/base/image/#=AirlineCode#.jpg\"/><span> #=AirlineName#</span></td>" + 
        "<td><div class=\"ClassType\"> //#=SegmentInfo[0].FareClass//#  </div></td>"+"</tr>"
    )

How should I write //#=SegmentInfo[0].FareClass//# section of could to get the value from Model Property SegmentInfo ,which is an class object and I need to access it's Property called FareClass which is string object.

Try to give the proper syntax to access this kind of object value.

Thanks in advance to my helper.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Pinaki Mukherjee
  • 185
  • 4
  • 10

1 Answers1

0

I am not sure how well it will work with an array but try.

.ClientRowTemplate( 
        "<tr>"+
        "<td style =\"width: 130px\"><img src=\"/Content/themes/base/image/#=AirlineCode#.jpg\"/><span> #=AirlineName#</span></td>" + 
        "<td><div class=\"ClassType\"> #=SegmentInfo[0].FareClass#  </div></td>"+"</tr>"
    )

(Remove the // completely)

Tim
  • 377
  • 7
  • 19