Hi
Why, if I use
UltraGrid1.Focus()
the Grid does not receive the focus?
Thanks
Hello Mariela77,
I have tried and the UltraGrid got the focus correctly. Could you please let me know what you would expect to happen after calling UltraGrid.Focus()?
Please feel free to let us know if you have any other questions.
Thanks, I now have more info.
I have a grid in which the user can insert lines by pressing Enter in the last column of the last line. In some cases, a line generates other lines that I make appear automatically, next to the first one, and are related to it but they are not enabled for the user to modify them.
When the user starts a new line, he has the option of using ESC to erase it and the focus should go the previous line. I have noted that when the previous line is one of these special ones that are not enabled, the Grid does not receive the focus but only when it is clicked... I think a line that is not enabled should receive the focus (even if it doesn't go in edit mode)...
Thanks again
Thank you for your feedback.
I would like just to add to this one more thing. You could use the built in PerformAction method of the UltraGrid like:
ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.BelowRow); or ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.AboveRow);You could use this method depends on the desired functionallity that you are looking for, so the focus will still remain inside the UltraGrid and doing so you will activate a row below or above the one that might be disabled. There are also other overloads of this method so please feel free to use the desired one that will suit the best in your current scenario.
If you have any other questions please feel free to contact us.
Thank you so much, this is very helpful.
I am glad that I was able to assist you here.
If you are having any other Infragistics related questions in the future please feel free to contact us.
Hello,
I have similar problem. Here is its description:
I have my own class which is child of UltraGrid and inside this class in event which triggers after data load in data structure I would like to focus first row. Problem is that when I reload data (using some button) it´s logical, that I lost focus on grid, but when I want to set focus inside UltraGrid using this.Focus() (inside this event) nothing happens. (Focus stays where was).
Anothir thing ... I have tried
this.PerformAction(UltraGridAction.FirstRowInGrid);this.Rows[0].Activate();this.Rows[0].Selected = true;
and it´s working, grid has actually selected first row, but don´t have focus and this is what I want.
Problem solved ... Reason was that grid has visibility = false during load so couldn´t be focused