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
2114
EmbeddableEditor for the Grid cell
posted

Please Help! To be simple this is my problem:

I have a class MyScore that "accepts" any string that "X:Y" represents, and converts it in the correct "X:Y" format. Say strings like "5:2", "0:0", "9:14" etc are accepted, and transformed in "X:Y"(where X and Y are any natural number), any other string is rejected, like "b:7" or "+9"

Now, I have a ScoreTextBox, that uses the MyScore class constructor that leaves the user to enter only valid scores, by default leaving "_:_" format.

So. Actually, I need to have exactly the same behavior like does my ScoreTextBox. Exactly the same. Is not desirable to rewrite or duplicate the existing ScoreTextBox code.

Now, I thought that putting myScoreTextBox instance as EditorControl to a cell will be sufficient. But I discovered that I need to implement on ScoretextBox a IProvidesEmbeddableEditor, so have an EmbeddableEditorBase.

Please help. I use the Score(string) constructor to determinate if the text is valid or not (in case of exception I invalidate the text to default one)

How can I implement Editor for this textBox, need I to do that?

 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    Sorry, but you lost me about half way through your post.

    serhiol said:
    Now, I have a ScoreTextBox, that uses the MyFoo class constructor that leaves the user to entter only valid scores, by default leaving "_:_" format.

    What is the "MyFoo" object?

    serhiol said:
    So. Actually, I need to have exactly the same behavior like does my ScoreTextBox. Exactly the same. Is not desirable to rewrite or duplicate the existing ScoreTextBox code.

    What exactly do you want to have the same behavior as the ScoreTextBox?

     

    I think what you have probably done is creating a control and you want to embed that control in a grid cell. In which case the way to do that is to use the UltraControlContainerEditor.

Children