Posted 18 August 2019, 11:37 pm EST
Hi Travis,
As per original post, it seems you are using the Visual Basic but in your latest post you have mentioned JAVA.
However, in case of ASP.NET MVC, you may use the following code for reference,
@(Html.C1().CollectionViewService().Id("cvCustomers")
.Bind(Url.Action("GridReadCustomer", "Home"))
.Update(Url.Action("GridUpdateCustomer", "Home"))
)
<script id="detailTemplate" type="text/template">
@(Html.C1().FlexGrid()
.Height("200px")
.AutoGenerateColumns(false)
.Id("orderGrid")
.Bind(b=>
{
b.Bind([b]Url.Action("GridReadOrder", "Home") + "?CustomerID={{CustomerID}}"[/b])
.Update(Url.Action("GridUpdateOrder", "Home") + "?CustomerID={{CustomerID}}") ;
})
.Columns(columns =>
{
columns.Add(column => column.Binding("ShippedDate").Width("*"));
columns.Add(column => column.Binding("Freight").Width("*").Align("Center"));
columns.Add(column => column.Binding("ShipVia").Width("*").Align("Center"));
})
.ToTemplate()
)
</script>
@(Html.C1().FlexGrid()
.ShowDetailRow(d => d.DetailRowTemplateId("detailTemplate").DetailVisibilityMode(C1.Web.Mvc.Grid.DetailVisibilityMode.ExpandSingle).IsAnimated(true))
.Id("detailRowFlexGrid")
.ItemsSourceId("cvCustomers")
)
Also please find the attached sample:
FlexGridDetailGrid_CRUD_Update.zip
- You may use the newItemCreator property of CollectionView accepting the Function which return default values for properties.
<script>
function SetDefault(s, e) {
return { Name: 'Default', Color: 'Black' };
}
</script>
@Html.C1().CollectionViewService().Bind(Model).NewItemCreator("SetDefault")
Hope it helps!
Regards,
Manish Gupta