k0de Posted October 14, 2011 Posted October 14, 2011 Hi. I use "DGGrid.SetFocus", but isn't work. How can I set focus on DBGrid? Help, please. Quote
dionel1969 Posted October 16, 2011 Posted October 16, 2011 Please, help. Any body. if you use property "ActiveControl := Grid1" from Form ??? Quote
k0de Posted October 16, 2011 Author Posted October 16, 2011 if you use property "ActiveControl := Grid1" from Form ??? It's not work. Quote
lema Posted October 16, 2011 Posted October 16, 2011 None of the Delphi ways to focus a component works. I also tried without any success the following javascript snippets. MainForm.UniDBGrid1.focus(); document.getElementById("some_id").focus(); Quote
ibandyop Posted October 16, 2011 Posted October 16, 2011 How can I set focus on DBGrid? Can you explain what you want to achieve. I do not understand you question. Also I should explain setfocus of a Cell in delphi needs EM_SETSEL window message to change to editbox that message is not available in a web browser and other operating systems. I do not know exact solution for you. But if you want focus where you mouse pointer is, you need scripting. Please read document Farshad has described below http://www.unigui.com/wpblog/2011/07/29/client-side-scripting-with-unigui/ and see example ClientEvents in http://prime.fmsoft.net/demo/ucdemo.dll Quote
k0de Posted October 16, 2011 Author Posted October 16, 2011 Can you explain what you want to achieve. I do not understand you question. Also I should explain setfocus of a Cell in delphi needs EM_SETSEL window message to change to editbox that message is not available in a web browser and other operating systems. I do not know exact solution for you. But if you want focus where you mouse pointer is, you need scripting. Please read document Farshad has described below http://www.unigui.com/wpblog/2011/07/29/client-side-scripting-with-unigui/ and see example ClientEvents in http://prime.fmsoft.net/demo/ucdemo.dll Thanks for the link, but it's not something that should be. Put on the form button and DBGrid1. What code I write to the event ButtonClick to switch the focus from the button to DBGrid1? And this should work in the browser. Quote
Administrators Farshad Mohajeri Posted October 16, 2011 Administrators Posted October 16, 2011 Workaround: procedure TMainForm.UniBitBtn1Click(Sender: TObject); begin if WebMode then UniSession.AddJS('MainForm.UniDBGrid1.getView().focusEl.focus();') else UniDBGrid1.SetFocus; end; Logged #1147 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.