Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Missing Add Row
posted

I have an UltraWinGrid on my form which is bound to an UltraDataSource. The schema is a primary band with one child band. My objective is to enable the user to only add new rows to the child band if the form is in edit mode.

I have the UI of the grid setup so that when the form loads, the Add Row for the child band is invisible. I accomplished this by setting the AllowAddNew property of the child band to AllowAddNew.No at design time. However, when the user clicks edit on the form's toolbar, I'd like to display the Add Row by setting its AllowAddNew property to AllowAddNew.TemplateOnBottom.

This works great if any of the primary rows already has one or more child rows. In that case, an Add Row is correctly displayed at the bottom of each child row collection, including those empty child row collections belonging to the primary rows with no child rows. In other words, I can expand any of the primary rows at this point and it will have at least one child row: namely, the Add Row. However, if none of the primary rows contains any child rows, no Add Rows are displayed at all so that the user is unable to add new child rows to any of the primary rows. Attempting to expand the primary rows in this case only makes the expansion indicator invisible as if there are no child rows, not even an add row. Is there a way to guarantee that the add rows will be displayed?

  • 140
    Verified Answer
    posted

    I decided to take a different approach where the Add Rows are not invisible, but just disabled. This appears to work well and I believe is a better solution.