kaki Posted April 18, 2023 Share Posted April 18, 2023 Hello, I need certain rows of a TUniDBGrid component to not be able to be selected or focused. Is this possible ? unigui version: 1.90.0.1564 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted April 18, 2023 Share Posted April 18, 2023 37 minutes ago, kaki said: Hello, I need certain rows of a TUniDBGrid component to not be able to be selected or focused. Is this possible ? unigui version: 1.90.0.1564 maybe this will help to you: https://stackoverflow.com/questions/36724468/dbgrid-how-to-prevent-a-row-from-being-selected Quote Link to comment Share on other sites More sharing options...
kaki Posted April 18, 2023 Author Share Posted April 18, 2023 Thanks for the answer, for now I can disable the line, but not the focus. Keep investigating. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18, 2023 Share Posted April 18, 2023 1 hour ago, kaki said: I need certain rows of a TUniDBGrid component to not be able to be selected or focused. Is this possible ? Hello, Can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
kaki Posted April 18, 2023 Author Share Posted April 18, 2023 Ok, I'll try it. I have a grid (TUniDBGRID), what I need is to insert some rows that are like a header, which will be defined with a field of the dataset, for example Type=0, under the headers there are other editable records, that's why the initial question , if it's possible for those header records to lose focus and look like panels or something. I hope I have explained myself. Thank you! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18, 2023 Share Posted April 18, 2023 20 minutes ago, kaki said: that's why the initial question If I understand you correctly, you can get logic from here, instead you can use beforeselect: Also on the forum there are solutions for using only the client side. Quote Link to comment Share on other sites More sharing options...
kaki Posted April 18, 2023 Author Share Posted April 18, 2023 Thanks, I'm checking the beforeselect method. a question, how can I validate a field of the model, I do it this way but it doesn't work for me function beforeselect(sender, record, index, eOpts) { if ( record.EmpNo == 5 ) { return false; }; } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18, 2023 Share Posted April 18, 2023 27 minutes ago, kaki said: record.EmpNo Using field index, for example: record.data[indx] Quote Link to comment Share on other sites More sharing options...
kaki Posted April 18, 2023 Author Share Posted April 18, 2023 Thanks, it works perfect. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18, 2023 Share Posted April 18, 2023 Okay, very good. Quote Link to comment Share on other sites More sharing options...
kaki Posted April 18, 2023 Author Share Posted April 18, 2023 9 hours ago, Sherzod said: Okay, very good. Sorry, not to open another thread, same procedure for certain rows there is the possibility of disabling the dblclick event Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18, 2023 Share Posted April 18, 2023 5 minutes ago, kaki said: dblclick event Why? Quote Link to comment Share on other sites More sharing options...
kaki Posted April 18, 2023 Author Share Posted April 18, 2023 Done, it works automatically by not focusing the line. Thank you! 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.