This question is locked. New answers and comments are not allowed.
Is it possible to insert detail rows under a newly created master row in an ajax hiearchical grid? Actually, what I would like to do is have the user add all the data at once - the user hits the New Record button and an empty row appears for the master row and a button or something to add new detail rows. Once all data is entered, the user hits the Save button and an action is called sending all rows (master and detail). I am using in cell editing. Is this at all possible? If not, should I switch to pop-up editing - or is this possible with server-side hierarchy? Any guidance is very much appreciated. My code follows:
Grid:
Models:
Thank you!
Donna
Grid:
<%= Html.Telerik().Grid(Of GMC_Hub_and_Spoke.WebQueryInputModel).Name("InputPropertiesGrid").HtmlAttributes(New With {.style = "width:95%;"}) _ .DataKeys(Function(key) key.Add(Function(k) k.WQI_Key)) _ .ToolBar(Function(commands) commands.Custom().Text("New Input Parameter and Properties").) _ .ToolBar(Function(commands) commands.SubmitChanges()) _ .ClientEvents(Function(events) events.OnError("onGridError")) _ .ClientEvents(Function(events) events.OnEdit("onGridEdit")) _ .DataBinding(Function(dataBinding) dataBinding.Ajax().Select("GetWQInputs", "WebQuery", New With {.id = Model.selectedWebQuery.QueryKey}).Update("UpdateWQInputs", "WebQuery")) _ .Editable(Function(editing) editing.Mode(GridEditMode.InCell)) _ .Columns(Function(cols) cols.Bound(Function(c) c.ParameterName)) _ .Columns(Function(cols) cols.Bound(Function(c) c.DisplayOrder)) _ .Columns(Function(cols) cols.Bound(Function(c) c.QueryKey).Hidden(True)) _ .Columns(Function(cols) cols.Bound(Function(c) c.WQI_Key).Hidden(True)) _ .DetailView(Function(detailView) detailView.ClientTemplate( _ Html.Telerik().Grid(Of GMC_Hub_and_Spoke.WQInputPropertyModel).Name("Properties_<#= WQI_Key #>") _ .DataKeys(Function(key) key.Add(Function(kk) kk.WQIP_Key)) _ .ToolBar(Function(commands) commands.Insert()) _ .ToolBar(Function(commands) commands.SubmitChanges()) _ .DataBinding(Function(dataBinding) dataBinding.Ajax().Select("GetInputProperties", "WebQuery", New With {.wqid = Model.selectedWebQuery.QueryKey, .wqipid = "<#= WQI_Key #>"}) _ .Update("UpdateInputProperties", "WebQuery")) _ .Editable(Function(editing) editing.Mode(GridEditMode.InCell)) _ .ClientEvents(Function(events) events.OnEdit("onWQIPGridEdit")) _ .ClientEvents(Function(events) events.OnRowDataBound("onWQIPRowDataBound")) _ .Columns(Function(col) col.Bound(Function(cc) cc.PropertyName)) _ .Columns(Function(col) col.Bound(Function(cc) cc.PropertyValue)) _ .Columns(Function(col) col.Bound(Function(cc) cc.NoEdit).Hidden(True)) _ .Columns(Function(col) col.Bound(Function(cc) cc.WQI_Key).Hidden(True)) _ .Columns(Function(col) col.Bound(Function(cc) cc.WQIP_Key).Hidden(True)) _ .ToHtmlString()))%>Models:
Imports com.gmcps.GMCDataModelPublic Class WebQueryInputModel Public Property WQI_Key As Integer Public Property QueryKey As Integer Public Property ParameterName As String Public Property DisplayOrder As Integer Public Property WebQueryInputProperties As List(Of WQInputPropertyModel)End ClassPublic Class WQInputPropertyModel Public Property WQIP_Key As Integer Public Property WQI_Key As Integer Public Property PropertyValue As String Public Property PropertyName As String Public Property NoEdit As BooleanEnd ClassThank you!
Donna