This question arose while configuring grids, but it's a more general question, which is why I'm posting it here. Here's the situation.
I was trying to set up a grid hierarchy using server binding and couldn't get the subgrid data to show up. Then I switched to using curly braces, @{ ... }, to surround the grid instead of parentheses, @( ... ), and it worked beautifully. So, here's the question: What is the difference between the syntax for the two grids below? (They both result in the same output.)
Grid with Parentheses:
Grid with Curly Braces:
Why is it better, if that's true, to use curly braces for a hierarchy scenario (with subgrid in DetailTemplate) than parentheses?
Thanks for any help!
Ken
I was trying to set up a grid hierarchy using server binding and couldn't get the subgrid data to show up. Then I switched to using curly braces, @{ ... }, to surround the grid instead of parentheses, @( ... ), and it worked beautifully. So, here's the question: What is the difference between the syntax for the two grids below? (They both result in the same output.)
Grid with Parentheses:
@(Html.Kendo().Grid(Model) .Name("JobCodesGrid") .Columns(columns => { columns.Bound(m => m.RegionID).Title("Region");
columns.Bound(m => m.JobCodeText).Title("Job Code"); }))Grid with Curly Braces:
@{Html.Kendo().Grid(Model) .Name("JobCodesGridBraced") .Columns(columns => { columns.Bound(m => m.RegionID).Title("Region"); columns.Bound(m => m.JobCodeText).Title("Job Code"); }) .Render();}Why is it better, if that's true, to use curly braces for a hierarchy scenario (with subgrid in DetailTemplate) than parentheses?
Thanks for any help!
Ken