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
802
Create Custom Editor Control
posted

Hello,

I am using a UltraGrid in my application that I am creating and I was wondering if there is a way to create a custom EditorControl that I could use for one (possibly more in the future) of my columns in the UltraGrid. The reason I am asking is because this column in particular that I am referring to will need to accomodate two things a value and a unit of measure (UOM).  The example pretty describes what I am trying to accomplish. It is important that the UOM stays directly beside the value. I realize that I could order the column so that the two are side by side, however it is also important to the client the user be able to move columns around however they see fit.

 If this is absolutely not a feasiable option, is there a way to for a lack of better word "glue" the two columns together so that wherever one was moved the other followed? Please advise.

 Adrian

Parents
No Data
Reply
  • 37774
    posted

     Adrian,

    It is not a trivial task to write your own embeddable editor, and would likely take you at the very least a few days to implement; the closest example of using one would be the RichTextEditor sample that ships with the SDK.  The way I see it, you have a couple options in addition to this:

    1) Use a RowEditTemplate, which was released in NA8.2.  This allows you to place any control you want to be used for editing, and you could apply the values to the cells as you see fit.

    2) Cancel the BeforeColPosChanged event if the user tries to move the UOM column.  In the AfterColPosChanged event, you could check to see if the user moved the Value column and if so, set the VisiblePosition of the UOM column to be right after that of the Value column.  You would probably have to keep a flag when you do this so that you know not to cancel it in the BeforeColPosChanged event (assuming it fires in this case).

    -Matt

Children
No Data