I have set my grids AddNewBox Hidden property to false. It is now showing two add new buttons as I have two bands (parent band with a child band).
How can I hide the add new button for the child band?
From what I could tell by looking at our code, there is no property that allows you to hide only one of the buttons. You could, however, probably use the IUIElementCreationFilter interface to prevent the element from appearing.
I'm not familiar with doing this, can you offer a simple example? Thanks..
Would disabling the button be sufficient? If so, you could just set the AllowAddNew property on the band.
this.ultraGrid1.DisplayLayout.Bands[1].Override.AllowAddNew = AllowAddNew.No;
CreationFilters are something of an advanced concept. If disabling the button won't do, then there are lots of sample here on the forums that use them for various things. You might want to search the forums and see if there's an example of one that does what you need or something similar.
Also, the Infragistics UIElementViewer Utility is a huge help when working with UIElements. Let us know if you need more help with the CreationFilter and we can try to point you in the right direction.
OK, thanks for the info - maybe this is a feature for the future?
I'll disable it for now and check out CreationFilters when I get a bit more time.
DeveloperDotNet said:maybe this is a feature for the future?
You should Submit a feature request to Infragistics.
No, nothing has changed in this regard. I guess there just weren't enough people asking for this feature for it to be a priority. Frankly, the AddNew box is obsolete at this point. Using the other AddNew options like the TemplateAddRow is a much better UI in general, and you can control the TemplateAddRow per band. So that would be one solution. Another would be to turn off the AddNew box and just provide the user with a button outside the grid to add rows to the parent band. If you have a single parent band and a single child band and you want to keep using the AddNew box and you just want to remove the AddNew button from the child band, you could probably achieve this using a CreationFilter to remove the button. But that would be the most difficult way to do it.
it's been nine years since the initial post, is there a direct way now, in code, to eliminate the AddNew button for the child band from displaying?