k0de Posted October 14, 2011 Share Posted October 14, 2011 Hi. I use "DGGrid.SetFocus", but isn't work. How can I set focus on DBGrid? Help, please. Link to comment Share on other sites More sharing options...
k0de Posted October 16, 2011 Author Share Posted October 16, 2011 Please, help. Any body. Link to comment Share on other sites More sharing options...
dionel1969 Posted October 16, 2011 Share Posted October 16, 2011 Please, help. Any body. if you use property "ActiveControl := Grid1" from Form ??? Link to comment Share on other sites More sharing options...
k0de Posted October 16, 2011 Author Share Posted October 16, 2011 if you use property "ActiveControl := Grid1" from Form ??? It's not work. Link to comment Share on other sites More sharing options...
lema Posted October 16, 2011 Share 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(); Link to comment Share on other sites More sharing options...
ibandyop Posted October 16, 2011 Share 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 Link to comment Share on other sites More sharing options...
k0de Posted October 16, 2011 Author Share 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. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted October 16, 2011 Administrators Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now