Hi all,
I've been cracking my head over the following:
I wanted a custom editor control for my ultragrid cells, that only allows the characters R, A, S, C and I in that order. The user can enable/disable any of the characters by pressing the associated key on the keyboard.
So e.g. pressing R, A and C would result in a string RA_C_ and pressing A, C and S after that would result in R_S__.
I tried to get this functionality done with a custom editor for the cell.I subclassed the UltraTextEditor and tried to catch that control's KeyPress events. However, that didn't work at all. I could actually get the events, but the data traffic between the ultragrid cell and the editor went terribly wrong.
I finally tried using the KeyPress event of the ultragrid and that worked! Instead of having all functionality in a separate user control, I put it in the ultragrid, and - although I don't like this kind of coding - I don't seem to be able to find another solution.
I hope I was able to help anyone struggling with the same problem.
PS: I was using v2009.1.
SabbeRubbish said:I subclassed the UltraTextEditor and tried to catch that control's KeyPress events. However, that didn't work at all. I could actually get the events, but the data traffic between the ultragrid cell and the editor went terribly wrong.
It's hard to offer advice here, since I'm not clear on exactly what went wrong.
But, in NetAdvantage 2009 Vol 2., we added a new editor called the UltraControlContainerEditor. This new editor is a component which allows you to embed any control you want in a grid cell. So you could create a UserControl or a derived TextBox or even an UltraTextEditor that does what you want and embed that in a grid cell and that would give you a lot more control over the interaction between the grid and the editor. So you would be able to handle the values any way you like.
Hi Mike!
Mike Saltzman"]But, in NetAdvantage 2009 Vol 2., we added a new editor called the UltraControlContainerEditor.
Did you introduce a similar control for use in the filter row of a grid?My problem is, that i need a combo editor, that can select multiple items in the filter row of my grid.
Thanks in advance.
It sounds like you are looking for the FilterUIProvider functionality that was added in the same version.
Does Infragistics have a sample of how to use the UltraControlContainerEditor with a UserControl? I have a UserControl that contains a masked edit box and a button. When I enter data into the masked editbox the data disappears when I leave the grid cell.
Yes, the NetAdvantage SDK includes a sample with many different uses of the UltraControlContainer, including a sample that uses a UserControl.