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.
Hi,
I supose that with small modification in my previous sample you could achieve desired behavior. Maybe you should loop through the ChildBands and set property AllowAddNew. Also you could using SetHeaderCheckedState() method to change Column`s header check box state. For example: CurrentBand.Columns[0].SetHeaderCheckedState(e.Rows, true);
Let me know if you have any further questions
I got the download (problem with 3rd party download software), but it doesn' do as I would like or I don't understand the sample.
Here is what I am looking at. You can see the "locked" checkbox under the green band. If any of those records in that band are locked then I want all the non green bands to not allow add new row (so the locking band is not a direct parent of the child tables but an uncle or great uncle (aka on a given band, need to to up its parent and then down to get to the locking flag). As you can see the greyed out records are because I set NoEdit flag on row activation but the New Row record is still there and editable. I don't want the add new row to appear for any of these bands which should not be editable. I don't really care if it is done via a event handler or simply via code on load. I can't figure out how to do it with code.
I hope this makes sense.
It looks like this is what I need but I can't download the zip file. It fails to unzip - says no files to extract (17 kB file). Can you repost...
I`m not sure that I understand your scenario, but I try to reproduce it in a small sample. Could you please take a look at the attached sample for more details and let me know if you think that I misunderstood your question. Please feel free to modify my sample and revert it back to me. I`ll be gald to research it
Regards