I have 10 bands in my grid and can disable a band's row Add with
layout.Bands[OBJECT_TYPE].Override.AllowAddNew =
AllowAddNew.No;
I however don't want to disable it for the band but a given row
aka, I want to do the following:
ActiveRow.ChildBands.AllowAddNew = AllowAddNew.No;
aka, I want to disable all the ability to add new under certain parent rows based on the data of the parent row. I tried disabling the row via:
foreach(UltraGridRow row in ActiveRow.Rows)
{
row.Activation = Activation.NoEdit;
}
but the New Row is not in the row collection so that didn't work. Alternatively I could do row.Hidden but can't get to the row to hide.
Thanks for shared approach. If you have any further questions, do not hesitate to write us
Finally figured it out by searching through bing.
I don't know if there is a better way of doing this but this works...
funcRow.ChildBands[0].Rows.TemplateAddRow.Hidden = bLockChildren ?
;
failureRow.ChildBands[0].Band.Override.AllowAddNew locks the band globally not just under the row which I would expect.
Figured it out...
failureRow.ChildBands[0].Band.Override.AllowAddNew - I was trying failureRow.ChildBands[0].Override or DisplayLayout et. al. but this resolves it.
Yes, I just need the call for this - that is what I want. I didn't see a childband override (I see Row overrides
>>Maybe you should loop through the ChildBands and set property AllowAddNew
I couldn't find the override except if it disallowed all records for the entire band which isn't what I want (I want just a band under a node rather than the band itself).
aka MyGrid.DisplayLayout.Bands[OBJECT_TYPE].Override.AllowAddNew = AllowNew.No; disabled adding new for all the rows (I want it to only disable for the given childband). I tried looking for MyGrid.ActiveRow.ChildBand[0].Override or something but couldn't find it. Maybe I am blind or missing something. I just need the syntax of the call and I will be good.