We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Automated testing of grid controls

I''m trying to automate testing of our derived grid control using NUnit and NUnit Forms. One issue I have is that when I try to do a test that involves keyboard input, it''s failing because it''s trying to set focus to the grid as a whole instead of the cell in the grid, as each key is pressed. How can I get the System.Windows.Forms.Control reference of the current cell so that I can have NUnit Forms set the focus there for keyboard input? Pete

2 Replies

AD Administrator Syncfusion Team November 17, 2004 10:10 AM

Not sure it will work for this setup, but you can try: this.grid.CurentCell.BeginEdit(); Or, maybe this.grid.CurrentCell.Renderer.Control.Focus(); You would probably need to check for nulls.


AD Administrator Syncfusion Team November 17, 2004 11:54 AM

Thanks Clay. That will probably do it. Unfortunately, I''ve just discovered that NUnit Forms has no facility for me to pass it a Control object. It''s got a really screwed up architecture and wants a form and control name. Nor does it even store the actual control reference, so there''s no way to simply add a constuctor to pass in the control. Guess I''ve got some work to do. Thanks. >Not sure it will work for this setup, but you can try: > >this.grid.CurentCell.BeginEdit(); > > >Or, maybe > > >this.grid.CurrentCell.Renderer.Control.Focus(); > > >You would probably need to check for nulls.

Loader.
Live Chat Icon For mobile
Up arrow icon