abhimanyu Posted February 15, 2017 Share Posted February 15, 2017 Hi,When I try to enable multiselect of uniDBGrid on button click it was not working. Below is code of button click, and attached a Demo as well. procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBGrid1.Options := UniDBGrid1.Options + [dgCheckSelect, dgRowSelect, dgMultiSelect]; end; procedure TMainForm.UniButton2Click(Sender: TObject); begin UniDBGrid1.Options := UniDBGrid1.Options - [dgCheckSelect, dgRowSelect, dgMultiSelect]; end; GridMultiSelect.zip Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted February 15, 2017 Administrators Share Posted February 15, 2017 Hi, Not all Grid options can be enabled/disabled at runtime. The only place that it can be done is Form's or Frame's OnCreate event. Quote Link to comment Share on other sites More sharing options...
abhimanyu Posted February 15, 2017 Author Share Posted February 15, 2017 Hi, Not all Grid options can be enabled/disabled at runtime. The only place that it can be done is Form's or Frame's OnCreate event. Is that any other way to enable multiselect or not? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 15, 2017 Share Posted February 15, 2017 Hi, You can use this approach for now: 1. Enable in designtime: [dgCheckSelect, dgRowSelect, dgMultiSelect] 2. Your logic: procedure TMainForm.UniButton1Click(Sender: TObject); begin //UniDBGrid1.Options := UniDBGrid1.Options + [dgCheckSelect, dgRowSelect, dgMultiSelect]; UniDBGrid1.JSInterface.JSCall('getSelectionModel().deselectAll', []); UniDBGrid1.JSInterface.JSCall('getSelectionModel().setSelectionMode', ['MULTI']); end; procedure TMainForm.UniButton2Click(Sender: TObject); begin //UniDBGrid1.Options := UniDBGrid1.Options - [dgCheckSelect, dgRowSelect, dgMultiSelect]; UniDBGrid1.JSInterface.JSCall('getSelectionModel().deselectAll', []); UniDBGrid1.JSInterface.JSCall('getSelectionModel().setSelectionMode', ['SINGLE']); end; Best regards. 3 Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 5, 2018 Share Posted June 5, 2018 Hello there everyones !! (: I would like to have a confirmation on that matter: http://forums.unigui.com/index.php?/topic/10516-unigui-1100/?p=56137 Regards, Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 5, 2018 Administrators Share Posted June 5, 2018 Hello there everyones !! (: I would like to have a confirmation on that matter: http://forums.unigui.com/index.php?/topic/10516-unigui-1100/?p=56137 Regards, Which one? Sent from my SM-N950F using Tapatalk Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 6, 2018 Share Posted June 6, 2018 "Well, my main problem is that I want to switch grid option between dgRwoSelect to dgEditing programmatically ! Is that possible ? If so, what approach should I take ? Thanks for your time ! ^_^" Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 8, 2018 Share Posted June 8, 2018 Hello Farshad, hello UniGUI Developers ! (: I would really appreciate if you could at least tell me if it is already possible and I am doing something wrong or if it is not possible at the moment and you are searching a solution or if you are just thinking about it .. Regards, Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 13, 2018 Share Posted June 13, 2018 Hello UniGUI developpers ! I am still waiting for an answer concerning that matter.... Regards, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 13, 2018 Share Posted June 13, 2018 Hi, Sorry for delay, can you still use the "FreeAndNil" solution? And I'm sorry that I again ask for clarification, what do you mean by saying "between dgRowSelect to dgEditing"? Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 13, 2018 Share Posted June 13, 2018 Hi, Sorry for delay, can you still use the "FreeAndNil" solution? And I'm sorry that I again ask for clarification, what do you mean by saying "between dgRowSelect to dgEditing"? I thought that the FreeAndNil matter was fixed?.. Clarification: Grid configured at conception with dgRowSelect. User click on a button and it programmatically change grid configuration to dgEditing. Regards, Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 18, 2018 Share Posted June 18, 2018 Hello UniGUi users! I wish I could have an answer concerning my question (waiting for two weeks now ) : Clarification: Grid configured at conception with dgRowSelect. User click on a button and it programmatically change grid configuration to dgEditing. Regards, Is that possible or not ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 18, 2018 Share Posted June 18, 2018 Hello, Sorry for delay Not all Grid options can be enabled/disabled at runtime. The only place that it can be done is Form's or Frame's OnCreate event. Sorry that maybe I do not really understand the situation, why you want that behavior, But, we will try to find an approach if possible Quote Link to comment Share on other sites More sharing options...
M477H13U Posted June 18, 2018 Share Posted June 18, 2018 Hello, Sorry for delay Sorry that maybe I do not really understand the situation, why you want that behavior, But, we will try to find an approach if possible Well, our client need a grid where they can : Some times select data for actions (PDF generation, validate data etc) --> dgMultiSelection Some times Insert Update Delete data --> dgEditing So in order to fulfill client's demands, we need a grid that is able to do these two things .. For now, we are destroying the grid and recreating it with correct options..! Quote Link to comment Share on other sites More sharing options...
M477H13U Posted August 6, 2018 Share Posted August 6, 2018 UP! (: Quote Link to comment Share on other sites More sharing options...
M477H13U Posted August 16, 2018 Share Posted August 16, 2018 Hello, Sorry for delay Sorry that maybe I do not really understand the situation, why you want that behavior, But, we will try to find an approach if possible Do you have any approach on this functionality ? We're still waiting for some news ! Regards, Quote Link to comment Share on other sites More sharing options...
M477H13U Posted September 20, 2018 Share Posted September 20, 2018 Quote Link to comment Share on other sites More sharing options...
Andriws Luna Posted June 26, 2020 Share Posted June 26, 2020 Put the grid in a frame, then free and re-create the frame with new options. I'm using this and it's works. 1 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.