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.
Figured it out...
failureRow.ChildBands[0].Band.Override.AllowAddNew - I was trying failureRow.ChildBands[0].Override or DisplayLayout et. al. but this resolves it.
failureRow.ChildBands[0].Band.Override.AllowAddNew locks the band globally not just under the row which I would expect.
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 ?
;
Thanks for shared approach. If you have any further questions, do not hesitate to write us