CiceroBillo Posted May 19, 2022 Share Posted May 19, 2022 Hi! I'm inserting new record in a Grid and I'd like to have cursor at first column, but cursor is positioned in the second column. The first column was defined a ReadOnly, but when Dataset is in Insert state I change the property ReadOnly to False, but this don't change the cursor position. How can I do That, please? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 26 minutes ago, CiceroBillo said: The first column was defined a ReadOnly, but when Dataset is in Insert state I change the property ReadOnly to False, but this don't change the cursor position. Hello, Do you have a simple testcase to check your case? Quote Link to comment Share on other sites More sharing options...
CiceroBillo Posted May 19, 2022 Author Share Posted May 19, 2022 10 minutes ago, Sherzod said: Hello, Do you have a simple testcase to check your case? You don't need a testcase. Just use your own grid demo and when you are inserting a record just setfocus randomly to any column as an example, please. Just for show how to focus any column/cell when you need it. Thank's. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 4 minutes ago, CiceroBillo said: You don't need a testcase. You or I will do this, but we still need a test case. 48 minutes ago, CiceroBillo said: The first column was defined a ReadOnly Okay. 48 minutes ago, CiceroBillo said: but when Dataset is in Insert state I change the property ReadOnly to False, but this don't change the cursor position. Please provide code how you do it. Quote Link to comment Share on other sites More sharing options...
CiceroBillo Posted May 19, 2022 Author Share Posted May 19, 2022 1 hour ago, Sherzod said: You or I will do this, but we still need a test case. Okay. Please provide code how you do it. procedure TfrmCadHISTORICO_ITENS.QryHistorico_DisciplinaBeforeInsert( DataSet: TDataSet); begin inherited; grdHistorico_Disciplina.ColumnByName('NomeDisciplina').ReadOnly := False; grdHistorico_Disciplina.ColumnByName('NomeDisciplina').Locked := False; end; On AfterPost I change to both properties to True. This working now. Quote Link to comment Share on other sites More sharing options...
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.