Dear Infragistics Team,
I am having a UltraTab instance with a UltraGrid instance within it. The focus has been set on the UltraTab using Tab.Selected command.
However our requirement is to have the focus set on a particular control (an UltraGrid) within the UltraTab. Please confirm if you can provide a code snippet that helps us to access the various controls within a UltraTab as well as set the focus on a particular Control (an UltraGrid).
Regards,
Dhiraj.
Hello Dhiraj,
It is possible to set focus to the UltraGrid, or any other control you have in the UltraTabControl, through a few ways. Below I've pasted a code snippet I used to write a button which switches to the tab and sets focus to the control within, using a few different methods, the last one focusing on a specific cell in the grid:
private void ultraButton1_Click(object sender, EventArgs e) { //set to the second tab ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[1]; //set focus to the grid, if you have a reference to that grid ultraGrid1.Focus(); //set focus to the first control in the TabPage's controls collection ultraTabControl1.Tabs[3].TabPage.Controls[0].Focus(); //set focus to specific cell ultraGrid1.ActiveCell = ultraGrid1.Rows[3].Cells[2]; }
Please let me know if I can provide any further assistance.
Dear John,
Thanks for the help. Your suggestion worked.