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?
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.
I wrote initially MyFoo, after that I changed it to "MyScore" to be more closer to the real project situation. I fixed this miss.
I really would like that the cell behaves(validates the value, and filters invalid input) like my ScoreTextBox does.
Unfortunately I didn't find a UltraControlContainerEditor in the Infragistics.Win.UltraWinEditors namespace. I use the 6.3 version of Infragistics, Normal 0 21 false false false MicrosoftInternetExplorer4 installed the latest "Service Release" of it.
UltraControlContainerEditor was added to NetAdvantage recently. It is not available in v6.3.In that version, there is no way to easily embed a control in a grid cell.
I recommend upgrading to the latest version.
Or you might want to search the forums and see if there is some sample code for positioning a control over a cell. That approach is much more difficult and requires you to handle a lot more events of the grid, but I think it might be possible to get what you want.