Hi All,
I've been trying to figure this out for a while and not having much luck hence this posting.
I have a grid that has a subgrid for each row using detailtables, both levels are editable. Because I have checkboxes in the admin form of each level I need to setup the value of any new rows in the InitInsert event and all of this works nicely.
I have two issues now. The fist issue is that I need to conditionally hide the checkbox (and potentially other fields) in the child level depending on a value in the parent level. The second issue is that I want to have a checkbox present on the form which when ticked and the record is saved a new insert form opens up - thus saving the user from clicking a on the new item icon again.
Re the first issue I have the following in the ItemCommand event for the grid,
Re the second issue I have tried the following code to trigger the insert form to reopen but although the itemcommand is triggered the insert form does not load.
Any help please?
Regards,
Jon
I've been trying to figure this out for a while and not having much luck hence this posting.
I have a grid that has a subgrid for each row using detailtables, both levels are editable. Because I have checkboxes in the admin form of each level I need to setup the value of any new rows in the InitInsert event and all of this works nicely.
I have two issues now. The fist issue is that I need to conditionally hide the checkbox (and potentially other fields) in the child level depending on a value in the parent level. The second issue is that I want to have a checkbox present on the form which when ticked and the record is saved a new insert form opens up - thus saving the user from clicking a on the new item icon again.
Re the first issue I have the following in the ItemCommand event for the grid,
...
ElseIf
e.CommandName =
"InitInsertElement"
Then
e.Canceled =
True
Dim
newValues
As
System.Collections.Specialized.ListDictionary =
New
System.Collections.Specialized.ListDictionary()
newValues(
"IncludeInTotal"
) =
True
'IF THE CostType CELL IN THE PARENT ROW = UnitCost THEN HIDE THE uxIncludeInTotal CHECKBOX ON THIS INSERT FORM
DirectCast
(e.Item, Telerik.Web.UI.GridDataItem).ChildItem.NestedTableViews(0).InsertItem(newValues)
ElseIf
.....
Re the second issue I have tried the following code to trigger the insert form to reopen but although the itemcommand is triggered the insert form does not load.
If
CType
(editedItem.FindControl(
"uxAddNewAfterSave"
), CheckBox).Checked
Then
Dim
parentItem =
CType
(e.Item.OwnerTableView.ParentItem, Telerik.Web.UI.GridDataItem)
parentItem.FireCommandEvent(
"InitInsertElement"
,
String
.Empty)
End
If
Any help please?
Regards,
Jon