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

Giving focus to Currentcell''s Usercontrol

Hi, I have a grid with a user control in the certains cells. When I click on the cell, I want my usercontrol to get the focus. However, the inner textbox (GridTextBoxControl) of your grid is taking the focus away from the user control when user clicks on the cell. When I did this: this.m_grid.ActivateCurrentCellBehavior = Syncfusion.Windows.Forms.Grid.GridCellActivateAction.SelectAll; The focus then stays with the usercontrol, however, the usercontrol does not show selectall in its TextBox, which is what I want. Giving the focus to my usercontrol in grid_CurrentCellActivated seems to fix the problem. But I am not sure, I am doing it the right way...Please advise.

1 Reply

AD Administrator Syncfusion Team November 29, 2005 09:32 AM UTC

Focus and user controls as grid cells are problematic. Each user control is different depending upon the child controls it hosts, and the exact behavior you want. There is no one technique that will work for all user controls, so if you have a solution that works, then go with it. If you want to upload a sample project showing what you are doing, then we can try it out and seee if we can spot potential problems with what you are doing.

Loader.
Live Chat Icon For mobile
Up arrow icon