Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

is it possible to create control via coding?

Lets say I have a shopping cart,I don't know how many different item a customer is going to buy, so I have to create a lot of editfields(I don't want to use editable table or report table) in advance, then hide some of them. Is it possible I can create new control on the fly?

Comments

  • Yes, you can do this using the CREATE Utility service. Unfortunately, the documentation doesn't spell out how do do this. Rather than create from scratch, you normally would use the ORIG_STRUCT property against a control you want to duplicate, make any necessary structural changes, and then use the CREATE service to create the control.
  • In my previous response, I wanted to give you a straight answer without introducing alternative ideas, especially when you had already said "I don't want to use editable table or report table".

    Therefore I'm creating a second response to address alternatives. May I ask why you would not consider the EditTable or ReportTable controls? Do you have a specific UI design in mind that precludes those controls? Are you worried about those controls being strictly row and column based?

    Before dismissing the SRP EditTable control, I want to remind you that this control has some special layout capabilities that might suit you rather well. The first is the RowsToRecords property. This property allows you to define a logical record to be mapped to multiple rows in the EditTable (as opposed to a single wide row). Thus, your "fields" are wrapped.

    The second feature is the CellMerge property. This property allows you to merge cells much like Excel, thus giving you a form-like experience.

    The SRP Editor Options dialog demonstrates this in the Quick Commands tab:



    Hopefully this presents new ideas you hadn't considered.
Sign In or Register to comment.